twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

The timezone changes when I go to the next month #93

Closed GijsGoudzwaard closed 8 years ago

GijsGoudzwaard commented 8 years ago

When I go to the next month it will go from Sat Oct 01 2016 00:00:00 GMT+0200 (CEST)

to Tue Nov 01 2016 00:00:00 GMT+0100 (CET)

This is what i'm doing: $scope.onViewTitleChanged = function(title) { console.log(new Date(title)); };

It only happens when I go to the next months not the previous ones

twinssbc commented 8 years ago

@GijsGoudzwaard I think this is expected because of DST?

> new Date(2016, 09, 1)
< Sat Oct 01 2016 00:00:00 GMT+0200 (CEST)
> new Date(2016, 10, 1)
< Tue Nov 01 2016 00:00:00 GMT+0100 (CET)
GijsGoudzwaard commented 8 years ago

You set me on the right track, it was because of DST. I managed to fix my problem by using new Date() instead of moment js

vaskolekoski commented 7 years ago

I got the same problem, can you give me some guidelines how to solve DST?