Dojo datePatterns and parsing

How to do dojo parsing dates without a slash while maintaining respect for the current language? Example:

Dates to be analyzed if locale:

  • an-us
    • 12/24/2010
    • 12/24/10
    • 12242010
    • 122410
  • yes dk
    • 12/24/2010
    • 12/24/10
    • 24122010
    • 241210

Currently, dojo parses only dates that contain slashes. Dates without slashes return null when parsed. Currently I only need to parse these two locales, but I would like to make a general method, so I can add more locales without changing the parsing. One possibility may be as follows:

  • Read both short and medium date format formats for the current locale
  • Remove slashes from both patterns.
  • , .
  • , ( ) .

, ? , , , . !:)

+3
1

. dijit.form.DateTextBox . , dojo/cldr ( , , ) ValidationTextBox ... , .

0

Source: https://habr.com/ru/post/1761521/


All Articles