@syncfusion/ej2-base 32.1.19 → 32.1.23

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.
@@ -878,7 +878,7 @@ var IntlBase;
878
878
  const fractionRegex = /[0-9]/g;
879
879
  IntlBase.defaultCurrency = '$';
880
880
  const mapper = ['infinity', 'nan', 'group', 'decimal'];
881
- const patternRegex = /G|M|L|H|c|'| a|yy|y|EEEE|E/g;
881
+ const patternRegex = /G|M|L|H|c|'| a|B|yy|y|EEEE|E/g;
882
882
  const patternMatch = {
883
883
  'G': '',
884
884
  'M': 'm',
@@ -887,6 +887,7 @@ var IntlBase;
887
887
  'c': 'd',
888
888
  '\'': '"',
889
889
  ' a': ' AM/PM',
890
+ 'B': 'AM/PM',
890
891
  'yy': 'yy',
891
892
  'y': 'yyyy',
892
893
  'EEEE': 'dddd',
@@ -5267,7 +5268,7 @@ var HijriParser;
5267
5268
  HijriParser.toGregorian = toGregorian;
5268
5269
  })(HijriParser || (HijriParser = {}));
5269
5270
 
5270
- const abbreviateRegexGlobal = /\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;
5271
+ const abbreviateRegexGlobal = /\/MMMMM|MMMM|MMM|a|B|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;
5271
5272
  const standalone = 'stand-alone';
5272
5273
  const weekdayKey = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
5273
5274
  const timeSetter = {
@@ -5290,6 +5291,7 @@ const datePartMatcher = {
5290
5291
  's': 'second',
5291
5292
  'L': 'month',
5292
5293
  'a': 'designator',
5294
+ 'B': 'designator',
5293
5295
  'z': 'timeZone',
5294
5296
  'Z': 'timeZone',
5295
5297
  'G': 'era',
@@ -5363,6 +5365,10 @@ class DateFormat$1 {
5363
5365
  formatOptions.designator = isBlazor() ?
5364
5366
  getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);
5365
5367
  break;
5368
+ case 'B':
5369
+ formatOptions.designator = isBlazor() ?
5370
+ getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);
5371
+ break;
5366
5372
  case 'G': {
5367
5373
  const eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';
5368
5374
  formatOptions.era = isBlazor() ? getValue('eras', dateObject) : getValue('eras.' + eText, dependable.dateObject);
@@ -5464,6 +5470,11 @@ class DateFormat$1 {
5464
5470
  ret += options.designator[`${desig}`];
5465
5471
  break;
5466
5472
  }
5473
+ case 'B': {
5474
+ const desigs = value.getHours() < 12 ? 'am' : 'pm';
5475
+ ret += options.designator[`${desigs}`];
5476
+ break;
5477
+ }
5467
5478
  case 'G': {
5468
5479
  const dec = value.getFullYear() < 0 ? 0 : 1;
5469
5480
  let retu = options.era[`${dec}`];
@@ -6158,10 +6169,15 @@ class DateParser {
6158
6169
  const tzone = options.timeZone;
6159
6170
  if (!isUndefined(y)) {
6160
6171
  const len = (y + '').length;
6161
- if (len <= 2) {
6172
+ const typedYearString = options.typedYearString || '';
6173
+ const isPaddedAncientYear = /^0{2,3}\d{1,2}$/.test(typedYearString);
6174
+ if (len <= 2 && !isPaddedAncientYear) {
6162
6175
  const century = Math.floor(res.getFullYear() / 100) * 100;
6163
6176
  y += century;
6164
6177
  }
6178
+ if (isPaddedAncientYear) {
6179
+ return null;
6180
+ }
6165
6181
  res.setFullYear(y);
6166
6182
  }
6167
6183
  for (const key of tKeys) {
@@ -6253,6 +6269,9 @@ class DateParser {
6253
6269
  let matchString = matches[curObject.pos];
6254
6270
  if (curObject.isNumber) {
6255
6271
  retOptions[`${prop}`] = this.internalNumberParser(matchString, num);
6272
+ if (prop === 'year' && !isNullOrUndefined(matchString)) {
6273
+ retOptions.typedYearString = matchString.trim();
6274
+ }
6256
6275
  }
6257
6276
  else {
6258
6277
  if (prop === 'timeZone' && !isUndefined(matchString)) {