-
Notifications
You must be signed in to change notification settings - Fork 30
/
main.js
52 lines (42 loc) · 1.38 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import alwaysArray from "../util/always_array";
export default function(cldr) {
var prepend, supplemental;
prepend = function(prepend) {
return function(path) {
path = alwaysArray(path);
return cldr.get([prepend].concat(path));
};
};
supplemental = prepend("supplemental");
// Week Data
// http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
supplemental.weekData = prepend("supplemental/weekData");
supplemental.weekData.firstDay = function() {
return (
cldr.get("supplemental/weekData/firstDay/{territory}") ||
cldr.get("supplemental/weekData/firstDay/001")
);
};
supplemental.weekData.minDays = function() {
var minDays =
cldr.get("supplemental/weekData/minDays/{territory}") ||
cldr.get("supplemental/weekData/minDays/001");
return parseInt(minDays, 10);
};
// Time Data
// http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
supplemental.timeData = prepend("supplemental/timeData");
supplemental.timeData.allowed = function() {
return (
cldr.get("supplemental/timeData/{territory}/_allowed") ||
cldr.get("supplemental/timeData/001/_allowed")
);
};
supplemental.timeData.preferred = function() {
return (
cldr.get("supplemental/timeData/{territory}/_preferred") ||
cldr.get("supplemental/timeData/001/_preferred")
);
};
return supplemental;
}