I am facing an issue while handling dates in Javascript/Typescript, where Day light saving is not observed like countries in India..
The code is working fine in countries like Canada, US where Day light saving is observed.
Date.prototype.stdTimezoneOffset = function() {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
Date.prototype.dst = function() {
return (this.getTimezoneOffset()) < this.stdTimezoneOffset();
}
P.S: Change your computer time zone to India Time zone while test.
Below are the links for Angular and Javascript resp.
https://stackblitz.com/edit/hello-angular-6-psxfnf?file=src/app/app.component.ts
https://jsfiddle.net/oc1uefbq/
Date is not getting handled properly.. for month like October
October 14 shall not represented as October 13..(In Angular code)