Skip to content
Permalink
Browse files

fix: dispay time on header

  • Loading branch information
ckhandla94 committed Mar 17, 2020
1 parent e2cf915 commit 0cdd5f6479e210c903b0179686053411e825fc6c
@@ -45,7 +45,7 @@ export class TimeTrackerComponent implements OnInit {
});
}

toggle(type: string) {
toggle() {
this.timeTrackerService.toggle();
}

@@ -77,12 +77,16 @@
[nbContextMenu]="supportContextMenu"
></nb-action>

<nb-action
<!-- <nb-action
icon="clock-outline"
class="toggle-layout"
[nbPopover]="timerCard"
[nbContextMenu]="supportContextMenu"
></nb-action>
></nb-action> -->

<nb-action [nbPopover]="timerCard">
<nb-icon class="mr-3" icon="clock-outline"></nb-icon>
{{ timerDueration }}
</nb-action>

<ng-template #timerCard>
<ngx-time-tracker></ngx-time-tracker>
@@ -14,6 +14,8 @@ import { Store } from '../../../@core/services/store.service';
import { SelectorService } from '../../../@core/utils/selector.service';
import { PermissionsEnum } from '@gauzy/models';
import { User } from '@gauzy/models';
import { TimeTrackerService } from '../../../@shared/time-tracker/time-tracker.service';
import * as moment from 'moment';

@Component({
selector: 'ngx-header',
@@ -43,6 +45,7 @@ export class HeaderComponent implements OnInit, OnDestroy {

private _selectedOrganizationId: string;
private _ngDestroy$ = new Subject<void>();
timerDueration: string;

constructor(
private sidebarService: NbSidebarService,
@@ -52,7 +55,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
private router: Router,
private translate: TranslateService,
private store: Store,
private selectorService: SelectorService
private timeTrackerService: TimeTrackerService
) {}

ngOnInit() {
@@ -65,6 +68,14 @@ export class HeaderComponent implements OnInit, OnDestroy {
// this.showSelectors(e['url']);
// });

this.timeTrackerService.$dueration
.pipe(takeUntil(this._ngDestroy$))
.subscribe((time) => {
this.timerDueration = moment
.utc(time * 1000)
.format('HH:mm:ss');
});

this.menuService
.onItemClick()
.pipe(filter(({ tag }) => tag === 'create-context-menu'))
@@ -11,6 +11,7 @@
"typescript.tsdk": "./node_modules/typescript/lib",
"debug.node.autoAttach": "on",
"search.usePCRE2": true,
"git.ignoreLimitWarning": true
"git.ignoreLimitWarning": true,
"checkpoints.showActiveFileOnly": true
}
}

0 comments on commit 0cdd5f6

Please sign in to comment.
You can’t perform that action at this time.