Fixed the JS dates issue

Please do this. Thanks.