mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
bug solve seltet date
This commit is contained in:
@@ -180,8 +180,18 @@ export class Utils {
|
||||
|
||||
addOneHourToIsoString(isoDateString) {
|
||||
let date = new Date(isoDateString);
|
||||
/* date.setHours(date.getHours()); */
|
||||
let newIsoDateString = date.toISOString();
|
||||
return newIsoDateString;
|
||||
|
||||
const tzOffset = -date.getTimezoneOffset(); // in minutes
|
||||
const diff = tzOffset >= 0 ? '+' : '-';
|
||||
const pad = (n: number) => (n < 10 ? '0' : '') + n;
|
||||
|
||||
return date.getFullYear() +
|
||||
'-' + pad(date.getMonth() + 1) +
|
||||
'-' + pad(date.getDate()) +
|
||||
'T' + pad(date.getHours()) +
|
||||
':' + pad(date.getMinutes()) +
|
||||
':' + pad(date.getSeconds()) +
|
||||
diff + pad(Math.floor(Math.abs(tzOffset) / 60)) +
|
||||
':' + pad(Math.abs(tzOffset) % 60);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user