This is a migrated thread and some comments may be shown as answers.

Date Localization in javascript

1 Answer 54 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Gauri
Top achievements
Rank 1
Gauri asked on 12 Dec 2019, 05:17 PM

Hello,

 

We have an application that is being hosted both USA and UK.

In there we have few javascriptf unctions.

1. Copy a date from raddatepicker to another 

     e.g. StartDate to SalaryStartDate in certain situaltions

2. Compares a manually entered date to be in a range

    e.g. SalaryStartDate should be between StartDate and EndDate

 

It loads the date properly from server side, also when manually selected it shows in correct format but it fails in javascript while assigning or comparing

 

Can anyone please help me figure out the solution?

 

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Dec 2019, 01:16 PM

Hello Gauri,

 

This is not specifically related to Telerik, but nevertheless I can provide you some directions so you can continue with achieving what you are looking for.

The Date objects have UTC/ISO methods in javascript which can be what exactly will work for your case:
https://www.geeksforgeeks.org/how-to-convert-a-javascript-date-to-utc/
https://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc

I hope this will prove helpful.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Calendar
Asked by
Gauri
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or