Skip to content

Commit 01f5192

Browse files
saithiselmomalmo
authored andcommitted
Update formatLong for DE locale (date-fns#1105)
1 parent 4b935b2 commit 01f5192

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/locale/de/_lib/formatLong/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js'
22

3+
// DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008
34
var dateFormats = {
4-
full: 'EEEE, do MMMM, y',
5-
long: 'do MMMM, y',
6-
medium: 'd MMM, y',
7-
short: 'dd.MM.y'
5+
full: 'EEEE, do MMMM y', // Montag, 7. Januar 2018
6+
long: 'do MMMM y', // 7. Januar 2018
7+
medium: 'do MMM. y', // 7. Jan. 2018
8+
short: 'dd.MM.y' // 07.01.2018
89
}
910

1011
var timeFormats = {
@@ -17,8 +18,8 @@ var timeFormats = {
1718
var dateTimeFormats = {
1819
full: "{{date}} 'um' {{time}}",
1920
long: "{{date}} 'um' {{time}}",
20-
medium: '{{date}}, {{time}}',
21-
short: '{{date}}, {{time}}'
21+
medium: '{{date}} {{time}}',
22+
short: '{{date}} {{time}}'
2223
}
2324

2425
var formatLong = {

src/locale/de/test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ describe('de locale', function () {
135135

136136
it('medium date', function () {
137137
var result = format(date, 'PP', {locale: locale})
138-
assert(result === '5 Apr, 1986')
138+
assert(result === '5. Apr. 1986')
139139
})
140140

141141
it('long date', function () {
142142
var result = format(date, 'PPP', {locale: locale})
143-
assert(result === '5. April, 1986')
143+
assert(result === '5. April 1986')
144144
})
145145

146146
it('full date', function () {
147147
var result = format(date, 'PPPP', {locale: locale})
148-
assert(result === 'Samstag, 5. April, 1986')
148+
assert(result === 'Samstag, 5. April 1986')
149149
})
150150

151151
it('short time', function () {
@@ -160,22 +160,22 @@ describe('de locale', function () {
160160

161161
it('short date + time', function () {
162162
var result = format(date, 'Pp', {locale: locale})
163-
assert(result === '05.04.1986, 10:32')
163+
assert(result === '05.04.1986 10:32')
164164
})
165165

166166
it('medium date + time', function () {
167167
var result = format(date, 'PPpp', {locale: locale})
168-
assert(result === '5 Apr, 1986, 10:32:00')
168+
assert(result === '5. Apr. 1986 10:32:00')
169169
})
170170

171171
it('long date + time', function () {
172172
var result = format(date, 'PPPp', {locale: locale})
173-
assert(result === '5. April, 1986 um 10:32')
173+
assert(result === '5. April 1986 um 10:32')
174174
})
175175

176176
it('full date + time', function () {
177177
var result = format(date, 'PPPPp', {locale: locale})
178-
assert(result === 'Samstag, 5. April, 1986 um 10:32')
178+
assert(result === 'Samstag, 5. April 1986 um 10:32')
179179
})
180180
})
181181
})

0 commit comments

Comments
 (0)