1

With some help from some fellow stack users, I currently have this:

http://jsfiddle.net/wZETP/

The JSON data gives me the {start.date} in YYYY-MM-DD formatting, but I would like to know how to implement a date change to:

Mon 01 Jan

1

1 Answer 1

1

Convert your date string "2012-05-29" to Date object:

var parts = date.split("-");
var d = new Date(parts[0], parts[1], parts[2]);

Then use dateFormat from here:

return d.format("ddd dd mmm");

Working fiddle

Sign up to request clarification or add additional context in comments.

1 Comment

I believe you shouldn't need to split on the date variable. You should be able to just pass in date as-is using new Date(date), and it will give you the correct date, assuming you ask for it in UTC.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.