Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Converts a date format, such as "*iso", "*mdy", "*ymd", or "*usa" to a pattern, such as "YYYY-MM-DD", "MM/DD/YY", "YY/MM/DD", or "MM/DD/YYYY".

Parameters

  1. Date format
  2. Separator (for example "/" or "-")
  3. Century (optional) - used to prepend to the pattern for "*cymd", "*cmdy", and "*cdmy" formats

Return value

String pattern

Example

Code Block
languagejavascript
console.log(pjs.getDatePattern("*mdy", "/"));  // outputs MM/DD/YY