Fishstick Kitty Fishstick Kitty - 1 year ago 199
jQuery Question

Jquery Globalize dateformatter how to format months with leading zeros

When I look at the documentation I can't find a way to do this...but I have the following formatter:

Globalize.dateFormatter({skeleton: "yMd"});

And it produces dates like: 8/24/2015. What I would like is 08/24/2015.

Here is a fiddle:

Any advice?

Answer Source

i had a look in Docs , but i didn't find a format for dd/MM/yyyy , so added it as one format , try this


JS (I am just providing a part of code here, see demo)

f = Globalize.dateFormatter({
    skeleton: "myFormat"

and data variable

"dateTimeFormats": { 
    "medium": "{1}, {0}",
        "availableFormats": {    
            "myFormat": "dd/MM/yyyy",
            // other formats

now use can use whatever the format (only valid format) you want in myFormat and you are free to change the name of myFormat.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download