-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
642 additions
and
83 deletions.
There are no files selected for viewing
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 +1 @@ | ||
["ar", "fil", "fr-CH", "mk", "nl-BE"] | ||
["ar", "fil", "fr-CH", "nl-BE"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js' | ||
|
||
var formatLong = buildFormatLongFn({ | ||
LT: 'h:mm aa', | ||
LTS: 'h:mm:ss aa', | ||
L: 'MM/DD/YYYY', | ||
LL: 'MMMM D YYYY', | ||
LLL: 'MMMM D YYYY h:mm aa', | ||
LLLL: 'dddd, MMMM D YYYY h:mm aa' | ||
}) | ||
var dateFormats = { | ||
full: 'EEEE, dd MMMM yyyy', | ||
long: 'dd MMMM yyyy', | ||
medium: 'dd MMM yyyy', | ||
short: 'dd/MM/yyyy' | ||
} | ||
|
||
var timeFormats = { | ||
full: 'HH:mm:ss zzzz', | ||
long: 'HH:mm:ss z', | ||
medium: 'HH:mm:ss', | ||
short: 'H:mm' | ||
} | ||
|
||
var dateTimeFormats = { | ||
any: '{{date}} {{time}}' | ||
} | ||
|
||
var formatLong = { | ||
date: buildFormatLongFn({ | ||
formats: dateFormats, | ||
defaultWidth: 'full' | ||
}), | ||
|
||
time: buildFormatLongFn({ | ||
formats: timeFormats, | ||
defaultWidth: 'full' | ||
}), | ||
|
||
dateTime: buildFormatLongFn({ | ||
formats: dateTimeFormats, | ||
defaultWidth: 'any' | ||
}) | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,92 @@ | ||
import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index.js' | ||
|
||
var weekdays = [ | ||
'недела', | ||
'понеделник', | ||
'вторник', | ||
'среда', | ||
'четврток', | ||
'петок', | ||
'сабота' | ||
] | ||
|
||
function lastWeek(day) { | ||
var weekday = weekdays[day] | ||
|
||
switch (day) { | ||
case 0: | ||
case 3: | ||
case 6: | ||
return "'минатата " + weekday + " во' p" | ||
case 1: | ||
case 2: | ||
case 4: | ||
case 5: | ||
return "'минатиот " + weekday + " во' p" | ||
} | ||
} | ||
|
||
function thisWeek(day) { | ||
var weekday = weekdays[day] | ||
|
||
switch (day) { | ||
case 0: | ||
case 3: | ||
case 6: | ||
return "'ова " + weekday + " вo' p" | ||
case 1: | ||
case 2: | ||
case 4: | ||
case 5: | ||
return "'овој " + weekday + " вo' p" | ||
} | ||
} | ||
|
||
function nextWeek(day) { | ||
var weekday = weekdays[day] | ||
|
||
switch (day) { | ||
case 0: | ||
case 3: | ||
case 6: | ||
return "'следната " + weekday + " вo' p" | ||
case 1: | ||
case 2: | ||
case 4: | ||
case 5: | ||
return "'следниот " + weekday + " вo' p" | ||
} | ||
} | ||
|
||
var formatRelativeLocale = { | ||
lastWeek: '[last] dddd [at] LT', | ||
yesterday: '[yesterday at] LT', | ||
today: '[today at] LT', | ||
tomorrow: '[tomorrow at] LT', | ||
nextWeek: 'dddd [at] LT', | ||
other: 'L' | ||
lastWeek: function(date, baseDate, options) { | ||
var day = date.getUTCDay() | ||
if (isSameUTCWeek(date, baseDate, options)) { | ||
return thisWeek(day) | ||
} else { | ||
return lastWeek(day) | ||
} | ||
}, | ||
yesterday: "'вчера во' p", | ||
today: "'денес во' p", | ||
tomorrow: "'утре во' p", | ||
nextWeek: function(date, baseDate, options) { | ||
var day = date.getUTCDay() | ||
if (isSameUTCWeek(date, baseDate, options)) { | ||
return thisWeek(day) | ||
} else { | ||
return nextWeek(day) | ||
} | ||
}, | ||
other: 'P' | ||
} | ||
|
||
export default function formatRelative(token, _date, _baseDate, _options) { | ||
return formatRelativeLocale[token] | ||
export default function formatRelative(token, date, baseDate, options) { | ||
var format = formatRelativeLocale[token] | ||
|
||
if (typeof format === 'function') { | ||
return format(date, baseDate, options) | ||
} | ||
|
||
return format | ||
} |
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
Oops, something went wrong.