react-moment 0.8.0 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/workspace.xml +234 -177
- package/README.md +76 -29
- package/coverage/clover.xml +105 -98
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/index.jsx.html +70 -34
- package/coverage/lcov-report/objects.js.html +1 -1
- package/coverage/lcov.info +210 -195
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -2
- package/package.json +3 -3
- package/src/index.jsx +41 -29
- package/tests/index.jsx +16 -0
package/coverage/lcov.info
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
TN:
|
|
2
2
|
SF:/media/sean/work2/www/react-moment/src/index.jsx
|
|
3
|
-
FN:
|
|
4
|
-
FN:
|
|
5
|
-
FN:
|
|
6
|
-
FN:
|
|
7
|
-
FN:
|
|
8
|
-
FN:
|
|
9
|
-
FN:
|
|
10
|
-
FN:
|
|
11
|
-
FN:
|
|
12
|
-
FN:
|
|
13
|
-
FN:
|
|
14
|
-
FN:
|
|
15
|
-
FN:
|
|
16
|
-
FN:
|
|
17
|
-
FN:
|
|
18
|
-
FN:
|
|
19
|
-
FN:
|
|
20
|
-
FN:
|
|
21
|
-
FN:
|
|
22
|
-
FN:
|
|
23
|
-
FN:
|
|
24
|
-
FN:
|
|
3
|
+
FN:68,(anonymous_0)
|
|
4
|
+
FN:69,(anonymous_1)
|
|
5
|
+
FN:87,(anonymous_2)
|
|
6
|
+
FN:89,(anonymous_3)
|
|
7
|
+
FN:90,(anonymous_4)
|
|
8
|
+
FN:101,(anonymous_5)
|
|
9
|
+
FN:114,(anonymous_6)
|
|
10
|
+
FN:129,(anonymous_7)
|
|
11
|
+
FN:142,(anonymous_8)
|
|
12
|
+
FN:178,(anonymous_9)
|
|
13
|
+
FN:192,(anonymous_10)
|
|
14
|
+
FN:199,(anonymous_11)
|
|
15
|
+
FN:211,(anonymous_12)
|
|
16
|
+
FN:220,(anonymous_13)
|
|
17
|
+
FN:229,(anonymous_14)
|
|
18
|
+
FN:236,(anonymous_15)
|
|
19
|
+
FN:240,(anonymous_16)
|
|
20
|
+
FN:249,(anonymous_17)
|
|
21
|
+
FN:262,(anonymous_18)
|
|
22
|
+
FN:274,(anonymous_19)
|
|
23
|
+
FN:324,(anonymous_20)
|
|
24
|
+
FN:332,(anonymous_21)
|
|
25
25
|
FNF:22
|
|
26
26
|
FNH:18
|
|
27
27
|
FNDA:37,(anonymous_0)
|
|
@@ -46,191 +46,206 @@ FNDA:0,(anonymous_18)
|
|
|
46
46
|
FNDA:38,(anonymous_19)
|
|
47
47
|
FNDA:38,(anonymous_20)
|
|
48
48
|
FNDA:38,(anonymous_21)
|
|
49
|
-
DA:
|
|
50
|
-
DA:
|
|
51
|
-
DA:
|
|
52
|
-
DA:
|
|
53
|
-
DA:
|
|
54
|
-
DA:
|
|
55
|
-
DA:
|
|
56
|
-
DA:
|
|
57
|
-
DA:
|
|
58
|
-
DA:
|
|
59
|
-
DA:
|
|
60
|
-
DA:
|
|
61
|
-
DA:
|
|
62
|
-
DA:
|
|
63
|
-
DA:
|
|
64
|
-
DA:
|
|
65
|
-
DA:
|
|
66
|
-
DA:
|
|
67
|
-
DA:
|
|
68
|
-
DA:
|
|
69
|
-
DA:
|
|
70
|
-
DA:140,76
|
|
71
|
-
DA:141,76
|
|
49
|
+
DA:7,1
|
|
50
|
+
DA:14,1
|
|
51
|
+
DA:19,1
|
|
52
|
+
DA:68,37
|
|
53
|
+
DA:88,1
|
|
54
|
+
DA:89,1
|
|
55
|
+
DA:90,0
|
|
56
|
+
DA:91,0
|
|
57
|
+
DA:92,0
|
|
58
|
+
DA:102,1
|
|
59
|
+
DA:103,0
|
|
60
|
+
DA:104,0
|
|
61
|
+
DA:105,0
|
|
62
|
+
DA:115,3
|
|
63
|
+
DA:116,0
|
|
64
|
+
DA:117,0
|
|
65
|
+
DA:119,3
|
|
66
|
+
DA:120,3
|
|
67
|
+
DA:130,4
|
|
68
|
+
DA:131,4
|
|
69
|
+
DA:132,1
|
|
72
70
|
DA:143,76
|
|
73
71
|
DA:144,76
|
|
74
|
-
DA:145,76
|
|
75
72
|
DA:146,76
|
|
76
|
-
DA:147,
|
|
77
|
-
DA:
|
|
78
|
-
DA:
|
|
79
|
-
DA:
|
|
80
|
-
DA:
|
|
81
|
-
DA:155,
|
|
82
|
-
DA:
|
|
83
|
-
DA:
|
|
84
|
-
DA:
|
|
85
|
-
DA:
|
|
86
|
-
DA:
|
|
87
|
-
DA:
|
|
88
|
-
DA:
|
|
89
|
-
DA:
|
|
73
|
+
DA:147,76
|
|
74
|
+
DA:148,76
|
|
75
|
+
DA:149,76
|
|
76
|
+
DA:150,4
|
|
77
|
+
DA:152,72
|
|
78
|
+
DA:155,76
|
|
79
|
+
DA:156,76
|
|
80
|
+
DA:157,2
|
|
81
|
+
DA:158,74
|
|
82
|
+
DA:162,6
|
|
83
|
+
DA:164,68
|
|
84
|
+
DA:166,76
|
|
85
|
+
DA:167,4
|
|
86
|
+
DA:170,76
|
|
87
|
+
DA:179,37
|
|
90
88
|
DA:180,37
|
|
89
|
+
DA:181,1
|
|
91
90
|
DA:183,37
|
|
92
|
-
DA:
|
|
93
|
-
DA:
|
|
94
|
-
DA:
|
|
95
|
-
DA:
|
|
96
|
-
DA:
|
|
97
|
-
DA:
|
|
98
|
-
DA:
|
|
99
|
-
DA:
|
|
100
|
-
DA:
|
|
101
|
-
DA:
|
|
102
|
-
DA:
|
|
103
|
-
DA:
|
|
104
|
-
DA:
|
|
105
|
-
DA:
|
|
106
|
-
DA:
|
|
107
|
-
DA:
|
|
108
|
-
DA:
|
|
109
|
-
DA:
|
|
110
|
-
DA:
|
|
111
|
-
DA:262,0
|
|
91
|
+
DA:186,37
|
|
92
|
+
DA:193,37
|
|
93
|
+
DA:200,37
|
|
94
|
+
DA:201,37
|
|
95
|
+
DA:202,3
|
|
96
|
+
DA:212,1
|
|
97
|
+
DA:221,1
|
|
98
|
+
DA:222,0
|
|
99
|
+
DA:230,1
|
|
100
|
+
DA:237,37
|
|
101
|
+
DA:238,37
|
|
102
|
+
DA:239,37
|
|
103
|
+
DA:240,34
|
|
104
|
+
DA:241,0
|
|
105
|
+
DA:250,38
|
|
106
|
+
DA:251,0
|
|
107
|
+
DA:252,0
|
|
108
|
+
DA:254,38
|
|
109
|
+
DA:255,4
|
|
112
110
|
DA:263,0
|
|
113
111
|
DA:265,0
|
|
114
|
-
DA:
|
|
115
|
-
DA:
|
|
116
|
-
DA:
|
|
117
|
-
DA:
|
|
112
|
+
DA:266,0
|
|
113
|
+
DA:268,0
|
|
114
|
+
DA:275,38
|
|
115
|
+
DA:279,38
|
|
118
116
|
DA:281,38
|
|
119
|
-
DA:
|
|
120
|
-
DA:
|
|
117
|
+
DA:283,38
|
|
118
|
+
DA:284,38
|
|
121
119
|
DA:285,38
|
|
122
120
|
DA:286,1
|
|
123
|
-
DA:
|
|
124
|
-
DA:
|
|
125
|
-
DA:
|
|
126
|
-
DA:
|
|
127
|
-
DA:
|
|
128
|
-
DA:
|
|
129
|
-
DA:
|
|
130
|
-
DA:
|
|
131
|
-
DA:
|
|
132
|
-
DA:
|
|
133
|
-
DA:
|
|
134
|
-
DA:
|
|
135
|
-
DA:
|
|
136
|
-
DA:
|
|
137
|
-
DA:
|
|
138
|
-
DA:
|
|
139
|
-
DA:306,
|
|
140
|
-
DA:
|
|
141
|
-
DA:
|
|
142
|
-
DA:
|
|
143
|
-
DA:
|
|
121
|
+
DA:288,38
|
|
122
|
+
DA:289,1
|
|
123
|
+
DA:292,38
|
|
124
|
+
DA:293,38
|
|
125
|
+
DA:294,38
|
|
126
|
+
DA:295,4
|
|
127
|
+
DA:296,34
|
|
128
|
+
DA:297,2
|
|
129
|
+
DA:298,32
|
|
130
|
+
DA:299,5
|
|
131
|
+
DA:300,27
|
|
132
|
+
DA:301,2
|
|
133
|
+
DA:302,25
|
|
134
|
+
DA:303,2
|
|
135
|
+
DA:304,23
|
|
136
|
+
DA:305,2
|
|
137
|
+
DA:306,21
|
|
138
|
+
DA:307,4
|
|
139
|
+
DA:308,17
|
|
140
|
+
DA:309,0
|
|
141
|
+
DA:310,17
|
|
142
|
+
DA:311,0
|
|
143
|
+
DA:313,17
|
|
144
|
+
DA:316,38
|
|
145
|
+
DA:317,0
|
|
146
|
+
DA:318,0
|
|
144
147
|
DA:321,38
|
|
145
|
-
DA:
|
|
148
|
+
DA:322,38
|
|
146
149
|
DA:324,38
|
|
147
|
-
DA:325,
|
|
148
|
-
DA:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
BRDA:
|
|
156
|
-
BRDA:
|
|
157
|
-
BRDA:
|
|
158
|
-
BRDA:
|
|
159
|
-
BRDA:
|
|
160
|
-
BRDA:
|
|
161
|
-
BRDA:
|
|
162
|
-
BRDA:
|
|
163
|
-
BRDA:
|
|
164
|
-
BRDA:
|
|
165
|
-
BRDA:
|
|
166
|
-
BRDA:
|
|
167
|
-
BRDA:
|
|
168
|
-
BRDA:
|
|
169
|
-
BRDA:
|
|
170
|
-
BRDA:
|
|
171
|
-
BRDA:
|
|
172
|
-
BRDA:
|
|
173
|
-
BRDA:
|
|
174
|
-
BRDA:
|
|
175
|
-
BRDA:
|
|
176
|
-
BRDA:
|
|
177
|
-
BRDA:
|
|
178
|
-
BRDA:
|
|
179
|
-
BRDA:
|
|
180
|
-
BRDA:
|
|
181
|
-
BRDA:
|
|
182
|
-
BRDA:
|
|
183
|
-
BRDA:
|
|
184
|
-
BRDA:
|
|
185
|
-
BRDA:
|
|
186
|
-
BRDA:
|
|
187
|
-
BRDA:
|
|
188
|
-
BRDA:
|
|
189
|
-
BRDA:
|
|
190
|
-
BRDA:
|
|
191
|
-
BRDA:
|
|
192
|
-
BRDA:
|
|
193
|
-
BRDA:
|
|
194
|
-
BRDA:
|
|
195
|
-
BRDA:
|
|
196
|
-
BRDA:
|
|
197
|
-
BRDA:
|
|
198
|
-
BRDA:
|
|
199
|
-
BRDA:
|
|
200
|
-
BRDA:
|
|
201
|
-
BRDA:
|
|
202
|
-
BRDA:
|
|
203
|
-
BRDA:
|
|
204
|
-
BRDA:
|
|
205
|
-
BRDA:
|
|
206
|
-
BRDA:
|
|
207
|
-
BRDA:
|
|
208
|
-
BRDA:
|
|
209
|
-
BRDA:
|
|
210
|
-
BRDA:
|
|
211
|
-
BRDA:
|
|
212
|
-
BRDA:
|
|
213
|
-
BRDA:
|
|
214
|
-
BRDA:
|
|
215
|
-
BRDA:
|
|
216
|
-
BRDA:
|
|
217
|
-
BRDA:
|
|
218
|
-
BRDA:
|
|
219
|
-
BRDA:
|
|
220
|
-
BRDA:
|
|
221
|
-
BRDA:
|
|
222
|
-
BRDA:
|
|
223
|
-
BRDA:
|
|
224
|
-
BRDA:
|
|
225
|
-
BRDA:
|
|
226
|
-
BRDA:
|
|
227
|
-
BRDA:
|
|
228
|
-
BRDA:
|
|
229
|
-
BRDA:
|
|
230
|
-
BRDA:
|
|
231
|
-
BRDA:
|
|
232
|
-
|
|
233
|
-
|
|
150
|
+
DA:325,38
|
|
151
|
+
DA:333,38
|
|
152
|
+
DA:335,38
|
|
153
|
+
DA:336,38
|
|
154
|
+
DA:337,0
|
|
155
|
+
DA:340,38
|
|
156
|
+
LF:107
|
|
157
|
+
LH:86
|
|
158
|
+
BRDA:87,0,0,0
|
|
159
|
+
BRDA:91,1,0,0
|
|
160
|
+
BRDA:91,1,1,0
|
|
161
|
+
BRDA:102,2,0,0
|
|
162
|
+
BRDA:102,2,1,1
|
|
163
|
+
BRDA:115,3,0,0
|
|
164
|
+
BRDA:115,3,1,3
|
|
165
|
+
BRDA:119,4,0,3
|
|
166
|
+
BRDA:119,4,1,0
|
|
167
|
+
BRDA:131,5,0,1
|
|
168
|
+
BRDA:131,5,1,3
|
|
169
|
+
BRDA:146,6,0,76
|
|
170
|
+
BRDA:146,6,1,68
|
|
171
|
+
BRDA:147,7,0,76
|
|
172
|
+
BRDA:147,7,1,70
|
|
173
|
+
BRDA:148,8,0,76
|
|
174
|
+
BRDA:148,8,1,74
|
|
175
|
+
BRDA:149,9,0,4
|
|
176
|
+
BRDA:149,9,1,72
|
|
177
|
+
BRDA:152,10,0,72
|
|
178
|
+
BRDA:152,10,1,72
|
|
179
|
+
BRDA:156,11,0,2
|
|
180
|
+
BRDA:156,11,1,74
|
|
181
|
+
BRDA:158,12,0,6
|
|
182
|
+
BRDA:158,12,1,68
|
|
183
|
+
BRDA:166,13,0,4
|
|
184
|
+
BRDA:166,13,1,72
|
|
185
|
+
BRDA:180,14,0,1
|
|
186
|
+
BRDA:180,14,1,36
|
|
187
|
+
BRDA:201,15,0,3
|
|
188
|
+
BRDA:201,15,1,34
|
|
189
|
+
BRDA:221,16,0,0
|
|
190
|
+
BRDA:221,16,1,1
|
|
191
|
+
BRDA:239,17,0,34
|
|
192
|
+
BRDA:239,17,1,3
|
|
193
|
+
BRDA:239,18,0,37
|
|
194
|
+
BRDA:239,18,1,34
|
|
195
|
+
BRDA:250,19,0,0
|
|
196
|
+
BRDA:250,19,1,38
|
|
197
|
+
BRDA:250,20,0,38
|
|
198
|
+
BRDA:250,20,1,34
|
|
199
|
+
BRDA:254,21,0,4
|
|
200
|
+
BRDA:254,21,1,34
|
|
201
|
+
BRDA:254,22,0,38
|
|
202
|
+
BRDA:254,22,1,4
|
|
203
|
+
BRDA:266,23,0,0
|
|
204
|
+
BRDA:266,23,1,0
|
|
205
|
+
BRDA:275,24,0,38
|
|
206
|
+
BRDA:275,24,1,0
|
|
207
|
+
BRDA:283,25,0,38
|
|
208
|
+
BRDA:283,25,1,33
|
|
209
|
+
BRDA:285,26,0,1
|
|
210
|
+
BRDA:285,26,1,37
|
|
211
|
+
BRDA:288,27,0,1
|
|
212
|
+
BRDA:288,27,1,37
|
|
213
|
+
BRDA:292,28,0,38
|
|
214
|
+
BRDA:292,28,1,2
|
|
215
|
+
BRDA:294,29,0,4
|
|
216
|
+
BRDA:294,29,1,34
|
|
217
|
+
BRDA:294,30,0,38
|
|
218
|
+
BRDA:294,30,1,5
|
|
219
|
+
BRDA:296,31,0,2
|
|
220
|
+
BRDA:296,31,1,32
|
|
221
|
+
BRDA:298,32,0,5
|
|
222
|
+
BRDA:298,32,1,27
|
|
223
|
+
BRDA:298,33,0,32
|
|
224
|
+
BRDA:298,33,1,28
|
|
225
|
+
BRDA:300,34,0,2
|
|
226
|
+
BRDA:300,34,1,25
|
|
227
|
+
BRDA:302,35,0,2
|
|
228
|
+
BRDA:302,35,1,23
|
|
229
|
+
BRDA:304,36,0,2
|
|
230
|
+
BRDA:304,36,1,21
|
|
231
|
+
BRDA:306,37,0,4
|
|
232
|
+
BRDA:306,37,1,17
|
|
233
|
+
BRDA:308,38,0,0
|
|
234
|
+
BRDA:308,38,1,17
|
|
235
|
+
BRDA:310,39,0,0
|
|
236
|
+
BRDA:310,39,1,17
|
|
237
|
+
BRDA:316,40,0,0
|
|
238
|
+
BRDA:316,40,1,38
|
|
239
|
+
BRDA:316,41,0,38
|
|
240
|
+
BRDA:316,41,1,38
|
|
241
|
+
BRDA:321,42,0,38
|
|
242
|
+
BRDA:321,42,1,38
|
|
243
|
+
BRDA:336,43,0,0
|
|
244
|
+
BRDA:336,43,1,38
|
|
245
|
+
BRDA:340,44,0,38
|
|
246
|
+
BRDA:340,44,1,38
|
|
247
|
+
BRF:89
|
|
248
|
+
BRH:74
|
|
234
249
|
end_of_record
|
|
235
250
|
TN:
|
|
236
251
|
SF:/media/sean/work2/www/react-moment/src/objects.js
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface MomentProps {
|
|
|
37
37
|
to?: dateTypes,
|
|
38
38
|
calendar?: calendarTypes,
|
|
39
39
|
diff?: dateTypes,
|
|
40
|
+
duration?: dateTypes,
|
|
41
|
+
durationFromNow?: boolean,
|
|
40
42
|
unit?: string,
|
|
41
43
|
decimal?: boolean,
|
|
42
44
|
unix?: boolean,
|
|
@@ -50,6 +52,7 @@ export interface MomentProps {
|
|
|
50
52
|
add?: subtractOrAddTypes,
|
|
51
53
|
children?: string | number,
|
|
52
54
|
style?: CSSProperties,
|
|
55
|
+
className?: string,
|
|
53
56
|
filter?: (date: string) => string,
|
|
54
57
|
onChange?: (content:any) => any
|
|
55
58
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment"),require("react")):"function"==typeof define&&define.amd?define(["moment","react"],t):"object"==typeof exports?exports["react-moment"]=t(require("moment"),require("react")):e["react-moment"]=t(e.moment,e.react)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment"),require("react")):"function"==typeof define&&define.amd?define(["moment","react"],t):"object"==typeof exports?exports["react-moment"]=t(require("moment"),require("react")):e["react-moment"]=t(e.moment,e.react)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(14),f=r(c),p=n(13),m=r(p),d=n(6),y=r(d);n(8);var g=n(7),h=[m.default.string,m.default.number,m.default.array,m.default.object],v=[m.default.string,m.default.array],b=[m.default.object,m.default.bool],w=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setTimer=function(){n.clearTimer();var e=n.props.interval;t.pooledTimer||0===e||(n.timer=setInterval(function(){n.update(n.props)},e))},n.clearTimer=function(){!t.pooledTimer&&n.timer&&(clearInterval(n.timer),n.timer=null),t.pooledTimer&&!n.timer&&t.removePooledElement(n)},n.getTitle=function(){var e=n.props.titleFormat,r=t.getDatetime(n.props),o=e||t.globalFormat;return r.format(o)},t.globalMoment||(t.globalMoment=y.default),n.state={content:""},n.timer=null,n}return u(t,e),s(t,null,[{key:"startPooledTimer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4;t.clearPooledTimer(),t.pooledTimer=setInterval(function(){t.pooledElements.forEach(function(e){0!==e.props.interval&&e.update()})},e)}},{key:"clearPooledTimer",value:function(){t.pooledTimer&&(clearInterval(t.pooledTimer),t.pooledTimer=null,t.pooledElements=[])}},{key:"pushPooledElement",value:function(e){return e instanceof t?void(t.pooledElements.indexOf(e)===-1&&t.pooledElements.push(e)):void console.error("Element not an instance of Moment.")}},{key:"removePooledElement",value:function(e){var n=t.pooledElements.indexOf(e);n!==-1&&t.pooledElements.splice(n,1)}},{key:"getDatetime",value:function(e){var n=e.utc,r=e.unix,o=e.date,i=e.locale,a=e.parse,u=e.tz;o=o||e.children,a=a||t.globalParse,u=u||t.globalTimezone,i=t.globalLocale?t.globalLocale:i||t.globalMoment.locale();var l=null;return l=n?t.globalMoment.utc(o,a,i):r?t.globalMoment(1e3*o,a,i):t.globalMoment(o,a,i),u&&(l=l.tz(u)),l}}]),s(t,[{key:"componentWillMount",value:function(){this.update(this.props)}},{key:"componentDidMount",value:function(){this.setTimer(),t.pooledTimer&&t.pushPooledElement(this)}},{key:"componentWillReceiveProps",value:function(e){this.update(e)}},{key:"componentDidUpdate",value:function(e){e.interval!==this.props.interval&&this.setTimer()}},{key:"componentWillUnmount",value:function(){this.clearTimer()}},{key:"update",value:function(e){var n=this;e=e||this.props;var r=e,o=r.fromNow,i=r.fromNowDuring,a=r.from,u=r.add,l=r.subtract,s=r.toNow,c=r.to,f=r.ago,p=r.calendar,m=r.diff,d=r.duration,g=r.durationFromNow,h=r.unit,v=r.decimal,b=e,w=b.format;w=w||t.globalFormat;var T=t.getDatetime(e);u&&T.add(u),l&&T.subtract(l);var S=Boolean(i)&&-T.diff((0,y.default)())<i,x="";x=w&&!S?T.format(w):a?T.from(a,f):o||S?T.fromNow(f):c?T.to(c,f):s?T.toNow(f):p?T.calendar(null,p):m?T.diff(m,h,v):d?T.diff(d):g?(0,y.default)().diff(T):T.toString(),(d||g)&&(x=y.default.duration(x),x=x.format(w));var O=t.globalFilter||this.props.filter;x=O(x),this.setState({content:x},function(){n.props.onChange(x)})}},{key:"render",value:function(){var e=this.props,n=e.withTitle,r=o(e,["withTitle"]),i=(0,g.objectKeyFilter)(r,t.propTypes);return n&&(i.title=this.getTitle()),f.default.createElement(t.globalElement||this.props.element,l({dateTime:t.getDatetime(this.props)},i),this.state.content)}}]),t}(f.default.Component);w.propTypes={element:m.default.any,date:m.default.oneOfType(h),parse:m.default.oneOfType(v),format:m.default.string,add:m.default.object,subtract:m.default.object,ago:m.default.bool,fromNow:m.default.bool,fromNowDuring:m.default.number,from:m.default.oneOfType(h),toNow:m.default.bool,to:m.default.oneOfType(h),calendar:m.default.oneOfType(b),unix:m.default.bool,utc:m.default.bool,tz:m.default.string,withTitle:m.default.bool,titleFormat:m.default.string,locale:m.default.string,interval:m.default.number,diff:m.default.oneOfType(h),duration:m.default.oneOfType(h),durationFromNow:m.default.bool,unit:m.default.string,decimal:m.default.bool,filter:m.default.func,onChange:m.default.func},w.defaultProps={element:"time",fromNow:!1,toNow:!1,calendar:!1,ago:!1,unix:!1,utc:!1,unit:null,withTitle:!1,decimal:!1,titleFormat:"",interval:6e4,filter:function(e){return e},onChange:function(){}},w.globalMoment=null,w.globalLocale=null,w.globalFormat=null,w.globalParse=null,w.globalFilter=null,w.globalElement=null,w.globalTimezone=null,w.pooledElements=[],w.pooledTimer=null,t.default=w},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){y&&m&&(y=!1,m.length?d=m.concat(d):g=-1,d.length&&u())}function u(){if(!y){var e=o(a);y=!0;for(var t=d.length;t;){for(m=d,d=[];++g<t;)m&&m[g].run();g=-1,t=d.length}m=null,y=!1,i(e)}}function l(e,t){this.fun=e,this.array=t}function s(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var m,d=[],y=!1,g=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new l(e,t)),1!==d.length||y||o(u)},l.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=s,p.addListener=s,p.once=s,p.off=s,p.removeListener=s,p.removeAllListeners=s,p.emit=s,p.prependListener=s,p.prependOnceListener=s,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){(function(t){"use strict";function n(e,t,n,o,i,a,u,l){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,u,l],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(1))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";var r=n(2),o=r;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}e.exports=o}).call(t,n(1))},function(t,n){t.exports=e},function(e,t){"use strict";function n(e,t){var n=Object.keys(t),r=Object.assign({},e);return Object.keys(r).filter(function(e){return n.indexOf(e)!==-1}).forEach(function(e){return delete r[e]}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.objectKeyFilter=n},function(e,t,n){var r,o,i;/*! Moment Duration Format v2.2.2
|
|
2
|
+
* https://github.com/jsmreese/moment-duration-format
|
|
3
|
+
* Date: 2018-02-16
|
|
4
|
+
*
|
|
5
|
+
* Duration format plugin function for the Moment.js library
|
|
6
|
+
* http://momentjs.com/
|
|
7
|
+
*
|
|
8
|
+
* Copyright 2018 John Madhavan-Reese
|
|
9
|
+
* Released under the MIT license
|
|
10
|
+
*/
|
|
11
|
+
!function(a,u){o=[n(6)],r=u,i="function"==typeof r?r.apply(t,o):r,!(void 0!==i&&(e.exports=i)),a&&(a.momentDurationFormatSetup=a.moment?u(a.moment):u)}(this,function(e){function t(e,t){return!(t.length>e.length)&&e.indexOf(t)!==-1}function n(e){for(var t="";e;)t+="0",e-=1;return t}function r(e){for(var t=e.split("").reverse(),n=0,r=!0;r&&n<t.length;)n?"9"===t[n]?t[n]="0":(t[n]=(parseInt(t[n],10)+1).toString(),r=!1):(parseInt(t[n],10)<5&&(r=!1),t[n]="0"),n+=1;return r&&t.push("1"),t.reverse().join("")}function o(e,t,i){var a=t.useToLocaleString,u=t.useGrouping,l=u&&t.grouping.slice(),s=t.maximumSignificantDigits,c=t.minimumIntegerDigits||1,f=t.fractionDigits||0,p=t.groupingSeparator,m=t.decimalSeparator;if(a&&i){var d={minimumIntegerDigits:c,useGrouping:u};if(f&&(d.maximumFractionDigits=f,d.minimumFractionDigits=f),s&&e>0&&(d.maximumSignificantDigits=s),!P){var y=w({},t);y.useGrouping=!1,y.decimalSeparator=".",e=parseFloat(o(e,y),10)}return e.toLocaleString(i,d)}var g;g=s?e.toPrecision(s+1):e.toFixed(f+1);var h,v,b,T=g.split("e");b=T[1]||"",T=T[0].split("."),v=T[1]||"",h=T[0]||"";var S=h.length,x=v.length,O=S+x,_=h+v;(s&&O===s+1||!s&&x===f+1)&&(_=r(_),_.length===O+1&&(S+=1),x&&(_=_.slice(0,-1)),h=_.slice(0,S),v=_.slice(S)),s&&(v=v.replace(/0*$/,""));var E=parseInt(b,10);E>0?v.length<=E?(v+=n(E-v.length),h+=v,v=""):(h+=v.slice(0,E),v=v.slice(E)):E<0&&(v=n(Math.abs(E)-h.length)+h+v,h="0"),s||(v=v.slice(0,f),v.length<f&&(v+=n(f-v.length)),h.length<c&&(h=n(c-h.length)+h));var j="";if(u){T=h;for(var V;T.length;)l.length&&(V=l.shift()),j&&(j=p+j),j=T.slice(-V)+j,T=T.slice(0,-V)}else j=h;return v&&(j=j+m+v),j}function i(e,t){return e.label.length>t.label.length?-1:e.label.length<t.label.length?1:0}function a(e,t){var n=[];return p(T(t),function(r){if("_durationLabels"===r.slice(0,15)){var o=r.slice(15).toLowerCase();p(T(t[r]),function(i){i.slice(0,1)===e&&n.push({type:o,key:i,label:t[r][i]})})}}),n}function u(e,t,n){return 1===t&&null===n?e:e+e}function l(e){return"[object Array]"===Object.prototype.toString.call(e)}function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){for(var n=e.length;n-=1;)if(t(e[n]))return e[n]}function f(e,t){var n,r=0,o=e&&e.length||0;for("function"!=typeof t&&(n=t,t=function(e){return e===n});r<o;){if(t(e[r]))return e[r];r+=1}}function p(e,t){var n=0,r=e.length;if(e&&r)for(;n<r;){if(t(e[n],n)===!1)return;n+=1}}function m(e,t){var n=0,r=e.length,o=[];if(!e||!r)return o;for(;n<r;)o[n]=t(e[n],n),n+=1;return o}function d(e,t){return m(e,function(e){return e[t]})}function y(e){var t=[];return p(e,function(e){e&&t.push(e)}),t}function g(e){var t=[];return p(e,function(e){f(t,e)||t.push(e)}),t}function h(e,t){var n=[];return p(e,function(e){p(t,function(t){e===t&&n.push(e)})}),g(n)}function v(e,t){var n=[];return p(e,function(r,o){if(!t(r))return n=e.slice(o),!1}),n}function b(e,t){var n=e.slice().reverse();return v(n,t).reverse()}function w(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function T(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function S(e,t){var n=0,r=e.length;if(!e||!r)return!1;for(;n<r;){if(t(e[n],n)===!0)return!0;n+=1}return!1}function x(e){var t=[];return p(e,function(e){t=t.concat(e)}),t}function O(){var e=0;try{e.toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}function _(){return"3.6"===3.55.toLocaleString("en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})}function E(){var e=!0;return!!(e=e&&O())&&(e=e&&"1"===1..toLocaleString("en",{minimumIntegerDigits:1}),e=e&&"01"===1..toLocaleString("en",{minimumIntegerDigits:2}),!!(e=e&&"001"===1..toLocaleString("en",{minimumIntegerDigits:3}))&&(e=e&&"100"===99.99.toLocaleString("en",{maximumFractionDigits:0,minimumFractionDigits:0}),e=e&&"100.0"===99.99.toLocaleString("en",{maximumFractionDigits:1,minimumFractionDigits:1}),e=e&&"99.99"===99.99.toLocaleString("en",{maximumFractionDigits:2,minimumFractionDigits:2}),!!(e=e&&"99.990"===99.99.toLocaleString("en",{maximumFractionDigits:3,minimumFractionDigits:3}))&&(e=e&&"100"===99.99.toLocaleString("en",{maximumSignificantDigits:1}),e=e&&"100"===99.99.toLocaleString("en",{maximumSignificantDigits:2}),e=e&&"100"===99.99.toLocaleString("en",{maximumSignificantDigits:3}),e=e&&"99.99"===99.99.toLocaleString("en",{maximumSignificantDigits:4}),!!(e=e&&"99.99"===99.99.toLocaleString("en",{maximumSignificantDigits:5}))&&(e=e&&"1,000"===1e3.toLocaleString("en",{useGrouping:!0}),e=e&&"1000"===1e3.toLocaleString("en",{useGrouping:!1}),!!e))))}function j(){var e,t=[].slice.call(arguments),n={};if(p(t,function(t,r){if(!r){if(!l(t))throw"Expected array as the first argument to durationsFormat.";e=t}return"string"==typeof t||"function"==typeof t?void(n.template=t):"number"==typeof t?void(n.precision=t):void(s(t)&&w(n,t))}),!e||!e.length)return[];n.returnMomentTypes=!0;var r=m(e,function(e){return e.format(n)}),o=h(M,g(d(x(r),"type"))),i=n.largest;return i&&(o=o.slice(0,i)),n.returnMomentTypes=!1,n.outputTypes=o,m(e,function(e){return e.format(n)})}function V(){var n=[].slice.call(arguments),r=w({},this.format.defaults),u=this.asMilliseconds(),c=this.asMonths();"function"==typeof this.isValid&&this.isValid()===!1&&(u=0,c=0);var x=u<0,O=e.duration(Math.abs(u),"milliseconds"),_=e.duration(Math.abs(c),"months");p(n,function(e){return"string"==typeof e||"function"==typeof e?void(r.template=e):"number"==typeof e?void(r.precision=e):void(s(e)&&w(r,e))});var E={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},j={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};r.types=M;var V=function(e){return f(M,function(t){return j[t].test(e)})},k=new RegExp(m(M,function(e){return j[e].source}).join("|"),"g");r.duration=this;var D="function"==typeof r.template?r.template.apply(r):r.template,P=r.outputTypes,F=r.returnMomentTypes,R=r.largest,A=[];P||(l(r.stopTrim)&&(r.stopTrim=r.stopTrim.join("")),r.stopTrim&&p(r.stopTrim.match(k),function(e){var t=V(e);"escape"!==t&&"general"!==t&&A.push(t)}));var q=e.localeData();q||(q={}),p(T(I),function(e){return"function"==typeof I[e]?void(q[e]||(q[e]=I[e])):void(q["_"+e]||(q["_"+e]=I[e]))}),p(T(q._durationTimeTemplates),function(e){D=D.replace("_"+e+"_",q._durationTimeTemplates[e])});var C=r.userLocale||e.locale(),G=r.useLeftUnits,U=r.usePlural,W=r.precision,z=r.forceLength,H=r.useGrouping,Y=r.trunc,$=r.useSignificantDigits&&W>0,K=$?r.precision:0,B=K,J=r.minValue,Q=!1,X=r.maxValue,Z=!1,ee=r.useToLocaleString,te=r.groupingSeparator,ne=r.decimalSeparator,re=r.grouping;ee=ee&&L;var oe=r.trim;l(oe)&&(oe=oe.join(" ")),null===oe&&(R||X||$)&&(oe="all"),null!==oe&&oe!==!0&&"left"!==oe&&"right"!==oe||(oe="large"),oe===!1&&(oe="");var ie=function(e){return e.test(oe)},ae=/large/,ue=/small/,le=/both/,se=/mid/,ce=/^all|[^sm]all/,fe=/final/,pe=R>0||S([ae,le,ce],ie),me=S([ue,le,ce],ie),de=S([se,ce],ie),ye=S([fe,ce],ie),ge=m(D.match(k),function(e,t){var n=V(e);return"*"===e.slice(0,1)&&(e=e.slice(1),"escape"!==n&&"general"!==n&&A.push(n)),{index:t,length:e.length,text:"",token:"escape"===n?e.replace(j.escape,"$1"):e,type:"escape"===n||"general"===n?null:n}}),he={index:0,length:0,token:"",text:"",type:null},ve=[];G&&ge.reverse(),p(ge,function(e){return e.type?((he.type||he.text)&&ve.push(he),void(he=e)):void(G?he.text=e.token+he.text:he.text+=e.token)}),(he.type||he.text)&&ve.push(he),G&&ve.reverse();var be=h(M,g(y(d(ve,"type"))));if(!be.length)return d(ve,"text").join("");be=m(be,function(e,t){var n,o=t+1===be.length,i=!t;n="years"===e||"months"===e?_.as(e):O.as(e);var a=Math.floor(n),u=n-a,l=f(ve,function(t){return e===t.type});return i&&X&&n>X&&(Z=!0),o&&J&&Math.abs(r.duration.as(e))<J&&(Q=!0),i&&null===z&&l.length>1&&(z=!0),O.subtract(a,e),_.subtract(a,e),{rawValue:n,wholeValue:a,decimalValue:o?u:0,isSmallest:o,isLargest:i,type:e,tokenLength:l.length}});var we=Y?Math.floor:Math.round,Te=function(e,t){var n=Math.pow(10,t);return we(e*n)/n},Se=!1,xe=!1,Oe=function(e,t){var n={useGrouping:H,groupingSeparator:te,decimalSeparator:ne,grouping:re,useToLocaleString:ee};return $&&(K<=0?(e.rawValue=0,e.wholeValue=0,e.decimalValue=0):(n.maximumSignificantDigits=K,e.significantDigits=K)),Z&&!xe&&(e.isLargest?(e.wholeValue=X,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),Q&&!xe&&(e.isSmallest?(e.wholeValue=J,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),e.isSmallest||e.significantDigits&&e.significantDigits-e.wholeValue.toString().length<=0?W<0?e.value=Te(e.wholeValue,W):0===W?e.value=we(e.wholeValue+e.decimalValue):$?(Y?e.value=Te(e.rawValue,K-e.wholeValue.toString().length):e.value=e.rawValue,e.wholeValue&&(K-=e.wholeValue.toString().length)):(n.fractionDigits=W,Y?e.value=e.wholeValue+Te(e.decimalValue,W):e.value=e.wholeValue+e.decimalValue):$&&e.wholeValue?(e.value=Math.round(Te(e.wholeValue,e.significantDigits-e.wholeValue.toString().length)),K-=e.wholeValue.toString().length):e.value=e.wholeValue,e.tokenLength>1&&(z||Se)&&(n.minimumIntegerDigits=e.tokenLength,xe&&n.maximumSignificantDigits<e.tokenLength&&delete n.maximumSignificantDigits),!Se&&(e.value>0||""===oe||f(A,e.type)||f(P,e.type))&&(Se=!0),e.formattedValue=o(e.value,n,C),n.useGrouping=!1,n.decimalSeparator=".",e.formattedValueEn=o(e.value,n,"en"),2===e.tokenLength&&"milliseconds"===e.type&&(e.formattedValueMS=o(e.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),e};if(be=m(be,Oe),be=y(be),be.length>1){var _e=function(e){return f(be,function(t){return t.type===e})},Ee=function(e){var t=_e(e.type);t&&p(e.targets,function(e){var n=_e(e.type);n&&parseInt(t.formattedValueEn,10)===e.value&&(t.rawValue=0,t.wholeValue=0,t.decimalValue=0,n.rawValue+=1,n.wholeValue+=1,n.decimalValue=0,n.formattedValueEn=n.wholeValue.toString(),xe=!0)})};p(N,Ee)}return xe&&(Se=!1,K=B,be=m(be,Oe),be=y(be)),!P||Z&&!r.trim?(pe&&(be=v(be,function(e){return!e.isSmallest&&!e.wholeValue&&!f(A,e.type)})),R&&be.length&&(be=be.slice(0,R)),me&&be.length>1&&(be=b(be,function(e){return!e.wholeValue&&!f(A,e.type)&&!e.isLargest})),de&&(be=m(be,function(e,t){return t>0&&t<be.length-1&&!e.wholeValue?null:e}),be=y(be)),!ye||1!==be.length||be[0].wholeValue||!Y&&be[0].isSmallest&&be[0].rawValue<J||(be=[])):(be=m(be,function(e){return f(P,function(t){return e.type===t})?e:null}),be=y(be)),F?be:(p(ve,function(e){var n=E[e.type],r=f(be,function(t){return t.type===e.type});if(n&&r){var o=r.formattedValueEn.split(".");o[0]=parseInt(o[0],10),o[1]?o[1]=parseFloat("0."+o[1],10):o[1]=null;var u=q.durationPluralKey(n,o[0],o[1]),l=a(n,q),s=!1,c={};p(q._durationLabelTypes,function(n){var r=f(l,function(e){return e.type===n.type&&e.key===u});r&&(c[r.type]=r.label,t(e.text,n.string)&&(e.text=e.text.replace(n.string,r.label),s=!0))}),U&&!s&&(l.sort(i),p(l,function(n){if(c[n.type]!==n.label){if(t(e.text,n.label))return e.text=e.text.replace(n.label,c[n.type]),!1}else if(t(e.text,n.label))return!1}))}}),ve=m(ve,function(e){if(!e.type)return e.text;var t=f(be,function(t){return t.type===e.type});if(!t)return"";var n="";return G&&(n+=e.text),(x&&Z||!x&&Q)&&(n+="< ",Z=!1,Q=!1),(x&&Q||!x&&Z)&&(n+="> ",Z=!1,Q=!1),x&&(t.value>0||""===oe||f(A,t.type)||f(P,t.type))&&(n+="-",x=!1),n+="milliseconds"===e.type&&t.formattedValueMS?t.formattedValueMS:t.formattedValue,G||(n+=e.text),n}),ve.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function k(){var e=this.duration,t=function(t){return e._data[t]},n=f(this.types,t),r=c(this.types,t);switch(n){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(n===r)return"d __";case"weeks":return n===r?"w __":(null===this.trim&&(this.trim="both"),"w __, d __, h __");case"months":if(n===r)return"M __";case"years":return n===r?"y __":(null===this.trim&&(this.trim="both"),"y __, M __, d __");default:return null===this.trim&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function D(e){if(!e)throw"Moment Duration Format init cannot find moment instance.";e.duration.format=j,e.duration.fn.format=V,e.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:k,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},e.updateLocale("en",I)}var L=!1,P=!1,M="escape years months weeks days hours minutes seconds milliseconds general".split(" "),N=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}],I={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:u};return L=E(),P=L&&_(),D(e),D})},function(e,t){/*
|
|
2
12
|
object-assign
|
|
3
13
|
(c) Sindre Sorhus
|
|
4
14
|
@license MIT
|
|
5
15
|
*/
|
|
6
|
-
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,u,l=n(e),
|
|
16
|
+
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,u,l=n(e),s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var c in r)i.call(r,c)&&(l[c]=r[c]);if(o){u=o(r);for(var f=0;f<u.length;f++)a.call(r,u[f])&&(l[u[f]]=r[u[f]])}}return l}},function(e,t,n){(function(t){"use strict";function r(e,n,r,l,s){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var f;try{o("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",l||"React class",r,c,typeof e[c]),f=e[c](n,c,l,r,null,a)}catch(e){f=e}if(i(!f||f instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",r,c,typeof f),f instanceof Error&&!(f.message in u)){u[f.message]=!0;var p=s?s():"";i(!1,"Failed %s type: %s%s",r,f.message,null!=p?p:"")}}}if("production"!==t.env.NODE_ENV)var o=n(3),i=n(5),a=n(4),u={};e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";var r=n(2),o=n(3),i=n(4);e.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){(function(t){"use strict";var r=n(2),o=n(3),i=n(5),a=n(9),u=n(4),l=n(10);e.exports=function(e,n){function s(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function f(e){this.message=e,this.stack=""}function p(e){function r(r,s,c,p,m,d,y){if(p=p||P,d=d||c,y!==u)if(n)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=p+":"+c;!a[g]&&l<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",d,p),a[g]=!0,l++)}return null==s[c]?r?new f(null===s[c]?"The "+m+" `"+d+"` is marked as required "+("in `"+p+"`, but its value is `null`."):"The "+m+" `"+d+"` is marked as required in "+("`"+p+"`, but its value is `undefined`.")):null:e(s,c,p,m,d)}if("production"!==t.env.NODE_ENV)var a={},l=0;var s=r.bind(null,!1);return s.isRequired=r.bind(null,!0),s}function m(e){function t(t,n,r,o,i,a){var u=t[n],l=E(u);if(l!==e){var s=j(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return p(t)}function d(){return p(r.thatReturnsNull)}function y(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){var l=E(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an array."))}for(var s=0;s<a.length;s++){var c=e(a,s,r,o,i+"["+s+"]",u);if(c instanceof Error)return c}return null}return p(t)}function g(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var u=E(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return p(t)}function h(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||P,u=k(t[n]);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return p(t)}function v(e){function n(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(c(a,e[u]))return null;var l=JSON.stringify(e);return new f("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+l+"."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function b(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],l=E(a);if("object"!==l)return new f("Invalid "+o+" `"+i+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var s in a)if(a.hasOwnProperty(s)){var c=e(a,s,r,o,i+"."+s,u);if(c instanceof Error)return c}return null}return p(t)}function w(e){function n(t,n,r,o,i){for(var a=0;a<e.length;a++){var l=e[a];if(null==l(t,n,r,o,i,u))return null}return new f("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var a=e[o];if("function"!=typeof a)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",V(a),o),r.thatReturnsNull}return p(n)}function T(){function e(e,t,n,r,o){return O(e[t])?null:new f("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(e)}function S(e){function t(t,n,r,o,i){var a=t[n],l=E(a);if("object"!==l)return new f("Invalid "+o+" `"+i+"` of type `"+l+"` "+("supplied to `"+r+"`, expected `object`."));for(var s in e){var c=e[s];if(c){var p=c(a,s,r,o,i+"."+s,u);if(p)return p}}return null}return p(t)}function x(e){function t(t,n,r,o,i){var l=t[n],s=E(l);if("object"!==s)return new f("Invalid "+o+" `"+i+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."));var c=a({},t[n],e);for(var p in c){var m=e[p];if(!m)return new f("Invalid "+o+" `"+i+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=m(l,p,r,o,i+"."+p,u);if(d)return d}return null}return p(t)}function O(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(O);if(null===t||e(t))return!0;var n=s(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!O(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!O(i[1]))return!1}return!0;default:return!1}}function _(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":_(t,e)?"symbol":t}function j(e){if("undefined"==typeof e||null===e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function V(e){var t=j(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function k(e){return e.constructor&&e.constructor.name?e.constructor.name:P}var D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",P="<<anonymous>>",M={array:m("array"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:d(),arrayOf:y,element:g(),instanceOf:h,node:T(),objectOf:b,oneOf:v,oneOfType:w,shape:S,exact:x};return f.prototype=Error.prototype,M.checkPropTypes=l,M.PropTypes=M,M}}).call(t,n(1))},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;e.exports=n(12)(o,i)}else e.exports=n(11)()}).call(t,n(1))},function(e,n){e.exports=t}])});
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-moment",
|
|
3
3
|
"description": "React component for the moment date library.",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Sean Hickey",
|
|
7
7
|
"web": "http://headzoo.io"
|
|
8
8
|
},
|
|
9
|
-
"dependencies": {},
|
|
10
9
|
"devDependencies": {
|
|
11
10
|
"@storybook/addon-actions": "^3.4.7",
|
|
12
11
|
"@storybook/addon-knobs": "^3.4.7",
|
|
@@ -28,9 +27,10 @@
|
|
|
28
27
|
"eslint-plugin-import": "^2.12.0",
|
|
29
28
|
"eslint-plugin-jsx-a11y": "^5.1.1",
|
|
30
29
|
"eslint-plugin-react": "^7.9.1",
|
|
31
|
-
"jest": "^
|
|
30
|
+
"jest": "^23.6.0",
|
|
32
31
|
"json-loader": "^0.5.4",
|
|
33
32
|
"moment": "^2.22.2",
|
|
33
|
+
"moment-duration-format": "^2.2.2",
|
|
34
34
|
"moment-timezone": "^0.5.17",
|
|
35
35
|
"prop-types": "^15.6.1",
|
|
36
36
|
"istanbul": "^0.4.5",
|