@bbn/bbn 2.0.13 → 2.0.15

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/dist/date.d.ts CHANGED
@@ -57,6 +57,7 @@ declare class bbnDateTool {
57
57
  get HH(): string;
58
58
  get H(): string;
59
59
  get II(): string;
60
+ get mm(): string;
60
61
  get I(): string;
61
62
  get SS(): string;
62
63
  get S(): string;
package/dist/date.js CHANGED
@@ -137,8 +137,6 @@ const unitsCorrespondence = {
137
137
  'YY': 'y',
138
138
  'yyyy': 'y',
139
139
  'yy': 'y',
140
- 'Y': 'y',
141
- 'y': 'y',
142
140
  'months': 'm',
143
141
  'month': 'm',
144
142
  'Months': 'm',
@@ -148,14 +146,10 @@ const unitsCorrespondence = {
148
146
  'MMMM': 'm',
149
147
  'MMM': 'm',
150
148
  'MM': 'm',
151
- 'M': 'm',
152
- 'm': 'm',
153
149
  'weekday': 'e',
154
150
  'WEEKDAY': 'e',
155
151
  'ee': 'e',
156
152
  'EE': 'e',
157
- 'e': 'e',
158
- 'E': 'e',
159
153
  'ddd': 'e',
160
154
  'days': 'd',
161
155
  'day': 'd',
@@ -164,9 +158,7 @@ const unitsCorrespondence = {
164
158
  'DAYS': 'd',
165
159
  'DAY': 'd',
166
160
  'DD': 'd',
167
- 'D': 'd',
168
161
  'dd': 'd',
169
- 'd': 'd',
170
162
  'hours': 'h',
171
163
  'hour': 'h',
172
164
  'Hours': 'h',
@@ -175,9 +167,7 @@ const unitsCorrespondence = {
175
167
  'HOUR': 'h',
176
168
  'HH': 'h',
177
169
  'hr': 'h',
178
- 'H': 'h',
179
170
  'hh': 'h',
180
- 'h': 'h',
181
171
  'minutes': 'i',
182
172
  'minute': 'i',
183
173
  'Minutes': 'i',
@@ -189,8 +179,6 @@ const unitsCorrespondence = {
189
179
  'mn': 'i',
190
180
  'mm': 'i',
191
181
  'min': 'i',
192
- 'n': 'i',
193
- 'i': 'i',
194
182
  'SS': 's',
195
183
  'ss': 's',
196
184
  'seconds': 's',
@@ -200,9 +188,21 @@ const unitsCorrespondence = {
200
188
  'SECONDS': 's',
201
189
  'SECOND': 's',
202
190
  'sec': 's',
191
+ 'WW': 'w',
192
+ 'Y': 'y',
193
+ 'y': 'y',
194
+ 'M': 'm',
195
+ 'm': 'm',
196
+ 'e': 'e',
197
+ 'E': 'e',
198
+ 'D': 'd',
199
+ 'd': 'd',
200
+ 'H': 'h',
201
+ 'h': 'h',
202
+ 'n': 'i',
203
+ 'i': 'i',
203
204
  's': 's',
204
205
  'S': 's',
205
- 'WW': 'w',
206
206
  'W': 'w',
207
207
  'w': 'w'
208
208
  };
@@ -450,6 +450,17 @@ class bbnDateTool {
450
450
  ctx.month = n;
451
451
  }
452
452
  },
453
+ {
454
+ token: 'mm',
455
+ regex: '\\d{2}',
456
+ apply: v => {
457
+ const n = parseInt(v, 10);
458
+ if (n < 0 || n > 59) {
459
+ throw new Error('Invalid minute: ' + n);
460
+ }
461
+ ctx.month = n;
462
+ }
463
+ },
453
464
  {
454
465
  token: 'M',
455
466
  regex: '\\d{1,2}',
@@ -979,6 +990,10 @@ class bbnDateTool {
979
990
  const i = parseInt(this.minute().toString());
980
991
  return i < 10 ? '0' + i.toString() : i.toString();
981
992
  }
993
+ get mm() {
994
+ const i = parseInt(this.minute().toString());
995
+ return i < 10 ? '0' + i.toString() : i.toString();
996
+ }
982
997
  get I() {
983
998
  return this.minute().toString();
984
999
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",