-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): add swedish locale (#2804)
* feat(datepicker): add swedish locale * fix(datepicker): fix country code for swedish Swedish is SV, not SE. SE is Northern Sami
- Loading branch information
1 parent
8b53225
commit eccb382
Showing
3 changed files
with
64 additions
and
2 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
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,61 @@ | ||
// moment.js locale configuration | ||
// locale : Swedish [sv] | ||
// author : Jens Alm : https://github.com/ulmus | ||
|
||
import { LocaleData } from '../locale/locale.class'; | ||
|
||
export const sv: LocaleData = { | ||
abbr: 'sv', | ||
months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), | ||
monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), | ||
weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), | ||
weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'), | ||
weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'), | ||
longDateFormat : { | ||
LT : 'HH:mm', | ||
LTS : 'HH:mm:ss', | ||
L : 'YYYY-MM-DD', | ||
LL : 'D MMMM YYYY', | ||
LLL : 'D MMMM YYYY [kl.] HH:mm', | ||
LLLL : 'dddd D MMMM YYYY [kl.] HH:mm', | ||
lll : 'D MMM YYYY HH:mm', | ||
llll : 'ddd D MMM YYYY HH:mm' | ||
}, | ||
calendar : { | ||
sameDay: '[Idag] LT', | ||
nextDay: '[Imorgon] LT', | ||
lastDay: '[Igår] LT', | ||
nextWeek: '[På] dddd LT', | ||
lastWeek: '[I] dddd[s] LT', | ||
sameElse: 'L' | ||
}, | ||
relativeTime : { | ||
future : 'om %s', | ||
past : 'för %s sedan', | ||
s : 'några sekunder', | ||
m : 'en minut', | ||
mm : '%d minuter', | ||
h : 'en timme', | ||
hh : '%d timmar', | ||
d : 'en dag', | ||
dd : '%d dagar', | ||
M : 'en månad', | ||
MM : '%d månader', | ||
y : 'ett år', | ||
yy : '%d år' | ||
}, | ||
dayOfMonthOrdinalParse: /\d{1,2}(e|a)/, | ||
ordinal : function (number) { | ||
const b = number % 10, | ||
// tslint:disable-next-line:no-bitwise | ||
output = (~~(number % 100 / 10) === 1) ? 'e' : | ||
(b === 1) ? 'a' : | ||
(b === 2) ? 'a' : | ||
(b === 3) ? 'e' : 'e'; | ||
return number + output; | ||
}, | ||
week : { | ||
dow : 1, // Monday is the first day of the week. | ||
doy : 4 // The week that contains Jan 4th is the first week of the year. | ||
} | ||
}; |
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