1

Basically I have date format which comes from server and which will be not known before and a date that was already formatted in this format, e.g. the format is "dd/MM/yyyy" and the date is "21/01/2018" (two strings). The format that uses jqx differs from the default JS one, as I can see.

What I need to do is to parse it to JavaScript date object. I couldn't find the answer in the official documentation.

Is there any easy was of parsing the date string if you know the date format, using JS, jqwidgets or momentjs?

Vladimir Mironov
  • 655
  • 1
  • 7
  • 23

1 Answers1

1

Eventually, I've finished with inner jqx method that does that exact thing:

var parsedDate = $.jqx.dataFormat.parsedate(src, format);

Where format in this case is "dd/MM/yyyy" and src is "21/01/2018".

P.S. Thanks for the guy that posted anwer with the code that used $.jqx.dataFormat, that really helped me to find parsedate method.

Vladimir Mironov
  • 655
  • 1
  • 7
  • 23