Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting Article Date #11

Closed
chrisbuttery opened this issue May 6, 2012 · 1 comment
Closed

Formatting Article Date #11

chrisbuttery opened this issue May 6, 2012 · 1 comment

Comments

@chrisbuttery
Copy link

Hi,
is there any way to format the output of an articles date?

title: Hello World
date: 2012-01-31 15:00

Currently, this date outputs to : Tue Jan 31 2012 15:00:00 GMT+1100 (EST)

I would like to have it formatted as '31 Jan 2012'.

I know I could just create another custom metadata item like "myDate: 31 Jan 2012", but it would
be cool to have it automatically formatted so I dont need to worry about updating it.

@jnordberg
Copy link
Owner

The date attribute of the page plugin returns a date object so you can format it as you like.

However it's not that convenient to format dates in javascript w/o some helper functions. I'm considering bundling some node date library to provide date formatting like date.format('Y-M-D H:i:s')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants