forked from date-fns/date-fns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed ordinal formatting for years, weeks, hours, minutes and seconds in `fr`, `fr-CA` and `fr-CH` locales. Fixed parser errors for `QQQ`, `QQQQQ` and `qqq` tokens in `fr`, `fr-CA` and `fr-CH` locales.
- Loading branch information
Showing
24 changed files
with
422 additions
and
821 deletions.
There are no files selected for viewing
23 changes: 12 additions & 11 deletions
23
src/locale/fr-CH/_lib/formatLong/index.js → src/locale/fr-CA/_lib/formatLong/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
import type { FormatLong } from '../../../types' | ||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index' | ||
|
||
var dateFormats = { | ||
const dateFormats = { | ||
full: 'EEEE d MMMM y', | ||
long: 'd MMMM y', | ||
medium: 'd MMM y', | ||
short: 'dd.MM.y' | ||
short: 'yy-MM-dd', | ||
} | ||
|
||
var timeFormats = { | ||
const timeFormats = { | ||
full: 'HH:mm:ss zzzz', | ||
long: 'HH:mm:ss z', | ||
medium: 'HH:mm:ss', | ||
short: 'HH:mm' | ||
short: 'HH:mm', | ||
} | ||
|
||
var dateTimeFormats = { | ||
const dateTimeFormats = { | ||
full: "{{date}} 'à' {{time}}", | ||
long: "{{date}} 'à' {{time}}", | ||
medium: '{{date}}, {{time}}', | ||
short: '{{date}}, {{time}}' | ||
short: '{{date}}, {{time}}', | ||
} | ||
|
||
var formatLong = { | ||
const formatLong: FormatLong = { | ||
date: buildFormatLongFn({ | ||
formats: dateFormats, | ||
defaultWidth: 'full' | ||
defaultWidth: 'full', | ||
}), | ||
|
||
time: buildFormatLongFn({ | ||
formats: timeFormats, | ||
defaultWidth: 'full' | ||
defaultWidth: 'full', | ||
}), | ||
|
||
dateTime: buildFormatLongFn({ | ||
formats: dateTimeFormats, | ||
defaultWidth: 'full' | ||
}) | ||
defaultWidth: 'full', | ||
}), | ||
} | ||
|
||
export default formatLong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
23 changes: 12 additions & 11 deletions
23
src/locale/fr-CA/_lib/formatLong/index.js → src/locale/fr-CH/_lib/formatLong/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
import type { FormatLong } from '../../../types' | ||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index' | ||
|
||
var dateFormats = { | ||
const dateFormats = { | ||
full: 'EEEE d MMMM y', | ||
long: 'd MMMM y', | ||
medium: 'd MMM y', | ||
short: 'yy-MM-dd' | ||
short: 'dd.MM.y', | ||
} | ||
|
||
var timeFormats = { | ||
const timeFormats = { | ||
full: 'HH:mm:ss zzzz', | ||
long: 'HH:mm:ss z', | ||
medium: 'HH:mm:ss', | ||
short: 'HH:mm' | ||
short: 'HH:mm', | ||
} | ||
|
||
var dateTimeFormats = { | ||
const dateTimeFormats = { | ||
full: "{{date}} 'à' {{time}}", | ||
long: "{{date}} 'à' {{time}}", | ||
medium: '{{date}}, {{time}}', | ||
short: '{{date}}, {{time}}' | ||
short: '{{date}}, {{time}}', | ||
} | ||
|
||
var formatLong = { | ||
const formatLong: FormatLong = { | ||
date: buildFormatLongFn({ | ||
formats: dateFormats, | ||
defaultWidth: 'full' | ||
defaultWidth: 'full', | ||
}), | ||
|
||
time: buildFormatLongFn({ | ||
formats: timeFormats, | ||
defaultWidth: 'full' | ||
defaultWidth: 'full', | ||
}), | ||
|
||
dateTime: buildFormatLongFn({ | ||
formats: dateTimeFormats, | ||
defaultWidth: 'full' | ||
}) | ||
defaultWidth: 'full', | ||
}), | ||
} | ||
|
||
export default formatLong |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { FormatRelativeFn } from '../../../types' | ||
|
||
const formatRelativeLocale = { | ||
lastWeek: "eeee 'la semaine dernière à' p", | ||
yesterday: "'hier à' p", | ||
today: "'aujourd’hui à' p", | ||
tomorrow: "'demain à' p'", | ||
nextWeek: "eeee 'la semaine prochaine à' p", | ||
other: 'P', | ||
} | ||
|
||
const formatRelative: FormatRelativeFn = (token, _date, _baseDate, _options) => | ||
formatRelativeLocale[token] | ||
|
||
export default formatRelative |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.