@rangertechnologies/ngnxt 2.1.258 → 2.1.260

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.
@@ -12,7 +12,7 @@ import { Mention } from 'quill-mention';
12
12
  import ImageResizor from 'quill-image-resizor';
13
13
  import * as i1 from '@ng-bootstrap/ng-bootstrap';
14
14
  import { NgbDatepickerI18n, NgbCalendar, NgbDatepickerModule, NgbCalendarIslamicUmalqura } from '@ng-bootstrap/ng-bootstrap';
15
- import * as moment from 'moment-hijri';
15
+ import moment from 'moment-hijri';
16
16
  import 'moment/locale/ar-sa';
17
17
  import { BehaviorSubject, Subject, debounceTime, distinctUntilChanged, takeUntil, catchError, of, merge, fromEvent } from 'rxjs';
18
18
  import * as i1$1 from '@angular/common/http';
@@ -4347,14 +4347,17 @@ class DataService {
4347
4347
  return result;
4348
4348
  }
4349
4349
  // SKS7AUG25 en numaral to hijri en numaral object
4350
- formatToGregorianString(date) {
4351
- const dateStr = `${date.year}-${date.month}-${date.day}`;
4352
- const hijriMoment = moment(dateStr, 'iYYYY-iM-iD');
4353
- if (date.time) {
4350
+ formatToGregorianString(date, type) {
4351
+ const dateStr = `${date.year}-${date.month}-${date.day || 1}`; // Use day=1 if not provided
4352
+ const hijriMoment = moment(dateStr, 'iYYYY-iM-iD').locale('en'); // Force English locale
4353
+ if (date.time && type !== 'month') {
4354
4354
  const [hours, minutes] = date.time.split(':').map(Number);
4355
4355
  hijriMoment.set({ hour: hours, minute: minutes });
4356
4356
  }
4357
- return hijriMoment.toDate().toISOString();
4357
+ if (type === 'month') {
4358
+ return hijriMoment.format('YYYY-MM'); // Gregorian year-month
4359
+ }
4360
+ return hijriMoment.toDate().toISOString(); // Full ISO Gregorian datetime
4358
4361
  }
4359
4362
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DataService, deps: [{ token: i1$1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
4360
4363
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DataService, providedIn: 'root' });
@@ -6924,7 +6927,7 @@ class NxtInput {
6924
6927
  this.languageCode = lang;
6925
6928
  });
6926
6929
  if (this.languageCode === 'ar') {
6927
- this.displayedHijriDate = this.type === 'time' ? this.value : this.dataService.formatToHijriString(this.value, this.type);
6930
+ this.displayedHijriDate = (this.type === 'datetime' || this.type === 'date' || this.type === 'month') ? this.dataService.formatToHijriString(this.value, this.type) : this.value;
6928
6931
  }
6929
6932
  }
6930
6933
  ngOnDestroy() {
@@ -7071,7 +7074,7 @@ class NxtInput {
7071
7074
  else if (this.type === 'month' || this.type === 'time') {
7072
7075
  if (this.languageCode === 'ar') {
7073
7076
  this.displayedHijriDate = event;
7074
- this.value = this.type === 'month' ? this.dataService.formatToGregorianString(event) : event;
7077
+ this.value = this.type === 'month' ? this.dataService.formatToGregorianString(event, this.type) : event;
7075
7078
  }
7076
7079
  else {
7077
7080
  const inputElement = event.target;
@@ -60842,7 +60845,7 @@ const VERSION = {
60842
60845
  "semver": null,
60843
60846
  "suffix": "09440148-dirty",
60844
60847
  "semverString": null,
60845
- "version": "2.1.258"
60848
+ "version": "2.1.260"
60846
60849
  };
60847
60850
  /* tslint:enable */
60848
60851