Details

Builds a JavaScript function that formats a date.

Ideally, use a format code (see datepat.json) to select how verbose the output should be.

You can also use a raw pattern, but then you will have to translate the pattern for each locale you support.

NOTE: Versions with names (vs numbers) require date format symbols.

Sample

df.js

Pattern Function Output