toDateString.d.ts 977 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { XEUtilsMethods } from '../xe-utils'
  2. export interface ToDateStringOptions {
  3. /**
  4. * 自定义格式化模板
  5. * {
  6. * formats: {
  7. * q: ['日', '一', '二', '三', '四', '五', '六'],
  8. * E: function (value, match, date) { return '三' }
  9. * }
  10. * }
  11. */
  12. formats?: any
  13. }
  14. /**
  15. * 日期格式化为任意格式字符串,转义符号 []
  16. * @param date 字符串/日期/时间戳
  17. * @param format 格式化 默认:yyyy-MM-dd HH:mm:ss.SSS
  18. * @param options 可选参数
  19. */
  20. export declare function toDateString(date: any, format?: string, options?: ToDateStringOptions): string;
  21. declare module '../xe-utils' {
  22. interface XEUtilsMethods {
  23. /**
  24. * 日期格式化为任意格式字符串,转义符号 []
  25. * @param date 字符串/日期/时间戳
  26. * @param format 格式化 默认:yyyy-MM-dd HH:mm:ss.SSS
  27. * @param options 可选参数
  28. */
  29. toDateString: typeof toDateString;
  30. }
  31. }
  32. export default toDateString