jQuery Globalize - How to add new calendar pattern

1.1k views Asked by At

I want to add support for the General Date Time Format to jQuery Globalize as it's the default format for outputting a DateTime as a string in .NET.

How can I extend an existing culture and add a new calendar pattern? The GitHub page documents the addCultureInfo function but I've been able to get this working with such a deep path:

calendars > standard > patterns.

1

There are 1 answers

0
dreamerkumar On

It took me a while to fiddle with it in the console of the browser, but here it is. Note, the addition is not within the calendars > standard > patterns.

Globalize.addCultureInfo("en-US", {
    calendar: {
        patterns: {
            X: 'ddd MMM dd yy'
        }
    } });