5 Answers, 1 is accepted
0
Hello,
The JavaScript Date object uses zero-based month values. With the given configuration, I do believe that the resulting date will be with +1 month than the desired one. The day value should stay the same. Our tests shows that indeed this is the case.
https://plnkr.co/edit/95vOpROaZYfe9kXfutZd?p=preview
Could you let me know if I am missing something?
As a side note, Typescript compiler doesn't parse zero padded numbers, like ''05", and will throw an error. The defined date should have the following params in our case:
Regards,
Georgi Krustev
Progress Telerik
The JavaScript Date object uses zero-based month values. With the given configuration, I do believe that the resulting date will be with +1 month than the desired one. The day value should stay the same. Our tests shows that indeed this is the case.
https://plnkr.co/edit/95vOpROaZYfe9kXfutZd?p=preview
Could you let me know if I am missing something?
As a side note, Typescript compiler doesn't parse zero padded numbers, like ''05", and will throw an error. The defined date should have the following params in our case:
new Date(2018, 4, 14)
Regards,
Georgi Krustev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Patrick
Top achievements
Rank 1
answered on 15 May 2018, 02:33 PM
ignore the 0, my question is why the new date will end up + 1 day or month or whatever. How to prevent that
birthDate: new FormControl(new Date(2018, 4, 14)) //2018-05-14T00:00:00
0
Hi,
My observations show that the component correctly displays the day value. In the above example the provided Date instance with `14` day will be diplsayed as `14` value in the input.
Could you modify the demo I've shared in order to demonstrate the issue? Also in what timezone and browser is tested the component?
Regards,
Georgi Krustev
Progress Telerik
My observations show that the component correctly displays the day value. In the above example the provided Date instance with `14` day will be diplsayed as `14` value in the input.
Could you modify the demo I've shared in order to demonstrate the issue? Also in what timezone and browser is tested the component?
Regards,
Georgi Krustev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Patrick
Top achievements
Rank 1
answered on 27 Jun 2018, 01:38 PM
Ok. This is very likely related to the timezone. Is there an option to set the timezone to EST instead of UTC by default?
Thanks,
Bryian Tan
0
Accepted
Hеllo,
The datepicker does not perform any timezone conversion. Is the date shown differently in the datepicker? From the formatted date(2018-05-14T00:00:00) that you provided it seems the Date is converted to JSON in which case the time will be converted to UTC. If this is the case then you can avoid the conversion by formatting the date before converting the data to JSON - example.
Regards,
Daniel
Progress Telerik
The datepicker does not perform any timezone conversion. Is the date shown differently in the datepicker? From the formatted date(2018-05-14T00:00:00) that you provided it seems the Date is converted to JSON in which case the time will be converted to UTC. If this is the case then you can avoid the conversion by formatting the date before converting the data to JSON - example.
Regards,
Daniel
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.