Closed anuragd7 closed 4 years ago
https://stackblitz.com/edit/ngx-countdown-setup 重现问题 [ x] Bug report [x ] Documentation issue or request
I want to display only hours and minutes in my ngx-countdown. I dont want to display seconds. I have set this up as follows in the code below:
html `<countdown
[config]="{ leftTime: leftTime, format: 'h:m', notify: [600, 120] }" (event)="handleEvent($event)" ></countdown>`
The left time is calculated as follows: ts `startCountDown(reviewEnd: string) {
const endTime = new Date(reviewEnd); const now = new Date(); if (now < endTime) { this.countdownExists = true; const endMilliSeconds = endTime.getTime(); const nowMilliSeconds = now.getTime(); this.leftTime = (endMilliSeconds - nowMilliSeconds) / 1000; }
}`
The time is now displaying correctly when there is atleast one hour left as below
However when the time is below 1 hour it shows it incorrectly as 12:22. See pic below
I would expect the time to be shown as 00:22.
Angular version: 8.2.14 ngx-countdown version: 8.0.2
Browser:
Use HH or H in your format. The link to accepted date/time formats in the documentation is a good reference.
HH
H
Thanks that solved it!
https://stackblitz.com/edit/ngx-countdown-setup 重现问题 [ x] Bug report [x ] Documentation issue or request
Current behavior
I want to display only hours and minutes in my ngx-countdown. I dont want to display seconds. I have set this up as follows in the code below:
html `<countdown
cd
The left time is calculated as follows: ts `startCountDown(reviewEnd: string) {
}`
The time is now displaying correctly when there is atleast one hour left as below
However when the time is below 1 hour it shows it incorrectly as 12:22. See pic below
Expected behavior
I would expect the time to be shown as 00:22.
Environment
Angular version: 8.2.14 ngx-countdown version: 8.0.2
Browser: