@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.
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * filename: index.d.ts
3
+ * version : 32.1.23
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
1
10
  import * as _base from '@syncfusion/ej2-base';
2
11
 
3
12
  export declare namespace ej {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-base",
3
- "version": "32.1.19",
3
+ "version": "32.1.23",
4
4
  "description": "A common package of Essential JS 2 base libraries, methods and class definitions",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -3,7 +3,7 @@ import { IntlBase as base, setDateFormat } from './intl-base';
3
3
  import { isUndefined, throwError, getValue, isBlazor } from '../util';
4
4
  import { HijriParser } from '../hijri-parser';
5
5
  import { isNullOrUndefined, extend } from '../util';
6
- var abbreviateRegexGlobal = /\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;
6
+ var abbreviateRegexGlobal = /\/MMMMM|MMMM|MMM|a|B|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;
7
7
  var standalone = 'stand-alone';
8
8
  var weekdayKey = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
9
9
  export var basicPatterns = ['short', 'medium', 'long', 'full'];
@@ -27,6 +27,7 @@ export var datePartMatcher = {
27
27
  's': 'second',
28
28
  'L': 'month',
29
29
  'a': 'designator',
30
+ 'B': 'designator',
30
31
  'z': 'timeZone',
31
32
  'Z': 'timeZone',
32
33
  'G': 'era',
@@ -104,6 +105,10 @@ var DateFormat = /** @class */ (function () {
104
105
  formatOptions.designator = isBlazor() ?
105
106
  getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);
106
107
  break;
108
+ case 'B':
109
+ formatOptions.designator = isBlazor() ?
110
+ getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);
111
+ break;
107
112
  case 'G': {
108
113
  var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';
109
114
  formatOptions.era = isBlazor() ? getValue('eras', dateObject) : getValue('eras.' + eText, dependable.dateObject);
@@ -206,6 +211,11 @@ var DateFormat = /** @class */ (function () {
206
211
  ret += options.designator["" + desig];
207
212
  break;
208
213
  }
214
+ case 'B': {
215
+ var desigs = value.getHours() < 12 ? 'am' : 'pm';
216
+ ret += options.designator["" + desigs];
217
+ break;
218
+ }
209
219
  case 'G': {
210
220
  var dec = value.getFullYear() < 0 ? 0 : 1;
211
221
  var retu = options.era["" + dec];
@@ -221,10 +221,15 @@ var DateParser = /** @class */ (function () {
221
221
  var tzone = options.timeZone;
222
222
  if (!isUndefined(y)) {
223
223
  var len = (y + '').length;
224
- if (len <= 2) {
224
+ var typedYearString = options.typedYearString || '';
225
+ var isPaddedAncientYear = /^0{2,3}\d{1,2}$/.test(typedYearString);
226
+ if (len <= 2 && !isPaddedAncientYear) {
225
227
  var century = Math.floor(res.getFullYear() / 100) * 100;
226
228
  y += century;
227
229
  }
230
+ if (isPaddedAncientYear) {
231
+ return null;
232
+ }
228
233
  res.setFullYear(y);
229
234
  }
230
235
  for (var _i = 0, tKeys_1 = tKeys; _i < tKeys_1.length; _i++) {
@@ -318,6 +323,9 @@ var DateParser = /** @class */ (function () {
318
323
  var matchString = matches[curObject.pos];
319
324
  if (curObject.isNumber) {
320
325
  retOptions["" + prop] = this.internalNumberParser(matchString, num);
326
+ if (prop === 'year' && !isNullOrUndefined(matchString)) {
327
+ retOptions.typedYearString = matchString.trim();
328
+ }
321
329
  }
322
330
  else {
323
331
  if (prop === 'timeZone' && !isUndefined(matchString)) {
@@ -48,7 +48,7 @@ export var IntlBase;
48
48
  var fractionRegex = /[0-9]/g;
49
49
  IntlBase.defaultCurrency = '$';
50
50
  var mapper = ['infinity', 'nan', 'group', 'decimal'];
51
- var patternRegex = /G|M|L|H|c|'| a|yy|y|EEEE|E/g;
51
+ var patternRegex = /G|M|L|H|c|'| a|B|yy|y|EEEE|E/g;
52
52
  var patternMatch = {
53
53
  'G': '',
54
54
  'M': 'm',
@@ -57,6 +57,7 @@ export var IntlBase;
57
57
  'c': 'd',
58
58
  '\'': '"',
59
59
  ' a': ' AM/PM',
60
+ 'B': 'AM/PM',
60
61
  'yy': 'yy',
61
62
  'y': 'yyyy',
62
63
  'EEEE': 'dddd',