index.d.ts 701 B

1234567891011121314151617181920212223
  1. //Extend Date
  2. interface Date {
  3. /**
  4. * Format a Date to string, pattern is below:
  5. * @param pattern - format string, like `"YYYY-MM-DD hh:mm:ss"`
  6. * 大写表示日期,小写一律表示时间,两位表示有前导0,一位表示无前导0
  7. * Uppercase represents date, lowsercase represents time
  8. * double char represents with prefix '0', single char represents without prefix '0'
  9. * Examples:
  10. * - YYYY/yyyy/YY/yy: year
  11. * - MM/M: month
  12. * - DD/D/dd/d: day
  13. * - HH/H/hh/h: hour(24)
  14. * - mm/m: minute
  15. * - ss/s: second
  16. * - Q/QQ: quater
  17. */
  18. format: (pattern?: string) => string;
  19. }
  20. interface DateConstructor {
  21. today(): number;
  22. }