Skip to content

Commit

Permalink
fix(date): 具名导出 formatDate
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 17, 2024
1 parent 5af0bc9 commit 8c0958a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/* istanbul ignore file */

// @index('../../node_modules/date-fns/index.mjs', /export \* from "\.\/(?!format)(.+)\.mjs"/g, m => `export * from 'date-fns/${m[1]}'`)
// @index('../../node_modules/date-fns/index.mjs', /export \* from "\.\/(.+)\.mjs"/g, m => `export * from 'date-fns/${m[1]}'`)
export * from 'date-fns/add'
export * from 'date-fns/addBusinessDays'
export * from 'date-fns/addDays'
Expand Down Expand Up @@ -69,6 +69,18 @@ export * from 'date-fns/endOfTomorrow'
export * from 'date-fns/endOfWeek'
export * from 'date-fns/endOfYear'
export * from 'date-fns/endOfYesterday'
export * from 'date-fns/format'
export * from 'date-fns/formatDistance'
export * from 'date-fns/formatDistanceStrict'
export * from 'date-fns/formatDistanceToNow'
export * from 'date-fns/formatDistanceToNowStrict'
export * from 'date-fns/formatDuration'
export * from 'date-fns/formatISO'
export * from 'date-fns/formatISO9075'
export * from 'date-fns/formatISODuration'
export * from 'date-fns/formatRFC3339'
export * from 'date-fns/formatRFC7231'
export * from 'date-fns/formatRelative'
export * from 'date-fns/fromUnixTime'
export * from 'date-fns/getDate'
export * from 'date-fns/getDay'
Expand Down Expand Up @@ -245,12 +257,15 @@ export {
zhCN as zhCNLocale,
} from 'date-fns/locale'

// @index(['./**/*.ts', '!./**/*.test.*'], f => `export * from '${f.path}'`)
// @index(['./**/(?!formatDate)*.ts', '!./**/*.test.*'], f => `export * from '${f.path}'`)
export * from './anyToDate'
export * from './formatDate'
export * from './formatDistanceAgo'
export * from './formatDistancePlus'
export * from './intervalToRestrictiveDuration'
export * from './ms'
export * from './numeralDayToChineseDay'
// @endindex

// date-fns 也导出了 formatDate
// 此处将 formatDate 作为具名导出以覆盖
export { formatDate, FormatDatePlaceholder, FormatDateRenderer } from './formatDate'

0 comments on commit 8c0958a

Please sign in to comment.