Dates and times should now be handled properly once the server is set on UTC time and the proper timezone offset environment variable is set.

This commit is contained in:
2021-04-02 06:58:38 +05:30
parent 0da16e9548
commit 97579ea9d3
13 changed files with 104 additions and 78 deletions

View File

@ -9,6 +9,11 @@ export class LocalTimePipe implements PipeTransform {
if (value === undefined) {
return '';
}
if (value.length === 5) {
return moment(value, 'HH:mm')
.subtract(new Date().getTimezoneOffset(), 'minutes')
.format('HH:mm');
}
return moment(value, 'DD-MMM-YYYY HH:mm')
.subtract(new Date().getTimezoneOffset(), 'minutes')
.format('DD-MMM-YYYY HH:mm');