time.d.ts 796 B

12345678910111213141516171819202122
  1. /**
  2. * Represent a time as a short/default/long 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('The time is now {T, time}')({ T: Date.now() })
  12. * // 'The time is now 11:26:35 PM'
  13. *
  14. * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() })
  15. * // 'Kello on nyt 23.26.35'
  16. *
  17. * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}');
  18. * cf({ T: '1969-07-20 20:17:40 UTC' })
  19. * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969'
  20. * ```
  21. */
  22. export declare function time(value: number | string, lc: string | string[], size?: 'short' | 'default' | 'long' | 'full'): string;