light-date
Version:
Blazing fast & lightweight (180 bytes) date formatting for Node.js and the browser.
14 lines (13 loc) • 553 B
TypeScript
declare const _default: (date: Date, exp: string, locale?: string | string[]) => string;
/**
* Use this API for locale-based formatting.
*
* @param {Date} date - Date object, which should be used.
* @param {string} exp - String, which you want to format, for example: `{MMMM}` or `Day of week: {EEE}`.
* @param {string | string[]} [locale="en-US"] - Locale(s), which will be used for formatting.
* @return {string} String with formatted date.
*
* @example
* localeFormat(new Date(2014, 1, 11), '{MMM}') //=> 'Jan'
*/
export default _default;