This repository was archived by the owner on Feb 24, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
core/src/lib/services/time-tracker
time-tracker/time-tracker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,6 +230,15 @@ export class TimeTrackerService implements OnDestroy {
230230 } else if ( error . status == 403 && error . error ?. message === TimeErrorsEnum . INVALID_PROJECT_PERMISSIONS ) {
231231 this . turnOffTimer ( ) ;
232232 this . toastrService . danger ( 'TIMER_TRACKER.PROJECT_PROJECT_PERMISSION_ERROR' ) ;
233+ } else if ( error . status === 409 && error . error ?. message === TimeErrorsEnum . WEEKLY_LIMIT_REACHED ) {
234+ this . turnOffTimer ( ) ;
235+ this . updateTimerStore ( {
236+ workedThisWeek : 0 ,
237+ reWeeklyLimit : 0
238+ } ) ;
239+ this . toastrService . danger ( 'TIMER_TRACKER.WEEKLY_LIMIT_EXCEEDED' ) ;
240+
241+ return Promise . reject ( error ) ;
233242 } else {
234243 console . error ( error ) ;
235244 }
Original file line number Diff line number Diff line change 1+ import { Pipe , PipeTransform } from '@angular/core' ;
2+ import * as moment from 'moment' ;
3+ import 'moment-duration-format' ;
4+
5+ @Pipe ( {
6+ name : 'humanDuration' ,
7+ standalone : false
8+ } )
9+ export class HumanDurationPipe implements PipeTransform {
10+ transform (
11+ value : number ,
12+ format ?: string ,
13+ settings ?: moment . DurationFormatSettings ,
14+ unitOfTime ?: moment . unitOfTime . DurationConstructor
15+ ) : string {
16+ return moment . duration ( value , unitOfTime || 'seconds' ) . format (
17+ format || 'HH:mm:ss' ,
18+ settings || {
19+ trim : false ,
20+ trunc : true
21+ }
22+ ) ;
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { UtcToLocalPipe } from './utc-to-local.pipe';
1313import { HashNumberPipe } from './hash-number.pipe' ;
1414import { UtcToTimezone } from './utc-to-timezone.pipe' ;
1515import { HoursDurationFormatPipe } from './duration-to-hours-format.pipe' ;
16+ import { HumanDurationPipe } from './human-duration.pipe' ;
1617
1718export { CurrencyPositionPipe } from './currency-position.pipe' ;
1819export { DateFormatPipe } from './date-format.pipe' ;
@@ -29,6 +30,7 @@ export { UtcToLocalPipe } from './utc-to-local.pipe';
2930export { HashNumberPipe } from './hash-number.pipe' ;
3031export { UtcToTimezone } from './utc-to-timezone.pipe' ;
3132export { HoursDurationFormatPipe } from './duration-to-hours-format.pipe' ;
33+ export { HumanDurationPipe } from './human-duration.pipe' ;
3234
3335export const Pipes = [
3436 CurrencyPositionPipe ,
@@ -47,5 +49,6 @@ export const Pipes = [
4749 UtcToLocalPipe ,
4850 UtcToTimezone ,
4951 HashNumberPipe ,
50- HoursDurationFormatPipe
52+ HoursDurationFormatPipe ,
53+ HumanDurationPipe
5154] ;
Original file line number Diff line number Diff line change @@ -64,9 +64,16 @@ <h6 *ngIf="isExpanded">
6464 {{ currentSessionTime }}
6565 </ span >
6666 < span class ="today-time mt-2 ">
67- {{ 'TIMER_TRACKER.TODAY' | translate }}
67+ {{ 'TIMER_TRACKER.TODAY' | translate }}:
6868 {{ todaySessionTime }}
6969 </ span >
70+ < span class ="today-time mt-2 ">
71+ {{ 'TIMESHEET.WEEKLY' | translate }}:
72+
73+ {{ (workedThisWeek$ | async) || 0 | humanDuration : 'HH:mm' }}
74+ /
75+ {{ (reWeeklyLimit$ | async) * 3600 || 0 | humanDuration : 'HH:mm' }}
76+ </ span >
7077 </ div >
7178 < span *ngIf ="limitReached " class ="today-time mt-2 invalid-feedback d-block ">
7279 {{ 'TOASTR.TITLE.MAX_LIMIT_REACHED' | translate }}
You can’t perform that action at this time.
0 commit comments