vollstock / prettyDate.js

A small helper function to beautify dates in Javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PrettyDate

A small helper function to beautify dates in Javascript.

Usage and Examples

Pretty date only has one function: prettyDate(date). It feeds the input date into a Javascript Date object and all the same input formats, the Date object does.

It returns a pretty string.

Include it to your doc

<script src="prettyDate.min.js"></script>

Then simply prettify your javascript dates

prettyDate(new Date());   // --> "Just now"
prettyDate("1979-08-31"); // --> "Aug 31st 1979"

Here are some examples of output.

License

It’s Beerware.

About

A small helper function to beautify dates in Javascript.


Languages

Language:JavaScript 100.0%