Skip to content

Commit

Permalink
fix weekday matcher in tr locale (date-fns#3045)
Browse files Browse the repository at this point in the history
Fix weekday matcher in the Turkish locale (`tr`).
  • Loading branch information
fturmel authored Jun 23, 2022
1 parent 8f87ef7 commit 2d6436b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/locale/tr/_lib/match/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Match } from '../../../types'
import type { Quarter } from '../../../../types'
import type { Match } from '../../../types'
import buildMatchFn from '../../../_lib/buildMatchFn/index'
import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'

Expand Down Expand Up @@ -71,19 +71,19 @@ const matchDayPatterns = {
narrow: /^[psçc]/i,
short: /^(pz|pt|sa|ça|pe|cu|ct)/i,
abbreviated: /^(paz|pzt|sal|çar|per|cum|cts)/i,
wide: /^(pazar|pazartesi|salı|çarşamba|perşembe|cuma|cumartesi)/i,
wide: /^(pazar(?!tesi)|pazartesi|salı|çarşamba|perşembe|cuma(?!rtesi)|cumartesi)/i,
}
const parseDayPatterns = {
narrow: [/^p/i, /^p/i, /^s/i, //i, /^p/i, /^c/i, /^c/i] as const,
any: [/^pz/i, /^pt/i, /^sa/i, /^ça/i, /^pe/i, /^cu/i, /^ct/i] as const,
wide: [
/^pazar/i,
/^pazar(?!tesi)/i,
/^pazartesi/i,
/^salı/i,
/^çarşamba/i,
/^perşembe/i,
/^cuma/i,
/cumartesi/i,
/^cuma(?!rtesi)/i,
/^cumartesi/i,
] as const,
}

Expand Down
8 changes: 4 additions & 4 deletions src/locale/tr/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
| | EEE | 2019-02-11T12:13:14.015Z | Pzt | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
| | EEEE | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
| | EEEE | 2019-02-11T12:13:14.015Z | Pazartesi | 2019-02-11T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
| | EEEEE | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
Expand All @@ -62,7 +62,7 @@
| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
| | iii | 2019-02-11T12:13:14.015Z | Pzt | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
| | iiii | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
| | iiii | 2019-02-11T12:13:14.015Z | Pazartesi | 2019-02-11T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
| | iiiii | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
Expand All @@ -72,7 +72,7 @@
| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
| | eee | 2019-02-11T12:13:14.015Z | Pzt | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
| | eeee | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
| | eeee | 2019-02-11T12:13:14.015Z | Pazartesi | 2019-02-11T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
| | eeeee | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
Expand All @@ -82,7 +82,7 @@
| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
| | ccc | 2019-02-11T12:13:14.015Z | Pzt | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
| | cccc | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
| | cccc | 2019-02-11T12:13:14.015Z | Pazartesi | 2019-02-11T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
| | ccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
Expand Down

0 comments on commit 2d6436b

Please sign in to comment.