date.d.ts 900 B

12345678910111213141516171819202122232425
  1. /**
  2. * Represent a date as a short/default/long/full string
  3. *
  4. * @param value Either a Unix epoch time in milliseconds, or a string value
  5. * representing a date. Parsed with `new Date(value)`
  6. *
  7. * @example
  8. * ```js
  9. * var mf = new MessageFormat(['en', 'fi']);
  10. *
  11. * mf.compile('Today is {T, date}')({ T: Date.now() })
  12. * // 'Today is Feb 21, 2016'
  13. *
  14. * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() })
  15. * // 'Tänään on 21. helmikuuta 2016'
  16. *
  17. * mf.compile('Unix time started on {T, date, full}')({ T: 0 })
  18. * // 'Unix time started on Thursday, January 1, 1970'
  19. *
  20. * var cf = mf.compile('{sys} became operational on {d0, date, short}');
  21. * cf({ sys: 'HAL 9000', d0: '12 January 1999' })
  22. * // 'HAL 9000 became operational on 1/12/1999'
  23. * ```
  24. */
  25. export declare function date(value: number | string, lc: string | string[], size?: 'short' | 'default' | 'long' | 'full'): string;