@acorex/platform 20.0.20 → 20.0.21

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.
@@ -1914,6 +1914,7 @@ class AXPDateTimeBoxWidgetEditComponent extends AXPValueWidgetComponent {
1914
1914
  constructor() {
1915
1915
  super(...arguments);
1916
1916
  this.validationService = inject(AXValidationService);
1917
+ this.settingService = inject(AXPSettingService);
1917
1918
  this.multiple = computed(() => this.options()['multiple']);
1918
1919
  this.clearButton = computed(() => this.options()['clearButton']);
1919
1920
  this.format = computed(() => {
@@ -1928,13 +1929,19 @@ class AXPDateTimeBoxWidgetEditComponent extends AXPValueWidgetComponent {
1928
1929
  this.disabled = computed(() => this.options()['disabled']);
1929
1930
  this.placeholder = computed(() => this.options()['placeholder']);
1930
1931
  this.internalValue = computed(() => Array.isArray(this.getValue()) ? this.getValue() : [this.getValue()]);
1931
- this.calendarFormat = computed(() => {
1932
- if (this.format() === 'date')
1933
- return 'DD/MM/YYYY';
1934
- else if (this.format() === 'time')
1935
- return 'HH:mm';
1936
- else
1937
- return 'DD/MM/YYYY HH:mm';
1932
+ this.calendarFormat = signal('date');
1933
+ this.#effect = effect(async () => {
1934
+ let mode = '';
1935
+ if (this.format() == 'date') {
1936
+ mode = await this.settingService.get('regional:short-date');
1937
+ }
1938
+ else if (this.format() == 'time') {
1939
+ mode = await this.settingService.get('regional:short-time');
1940
+ }
1941
+ else if (this.format() == 'datetime') {
1942
+ mode = `${await this.settingService.get('regional:short-date')} ${await this.settingService.get('regional:short-time')}`;
1943
+ }
1944
+ this.calendarFormat.set(mode);
1938
1945
  });
1939
1946
  }
1940
1947
  handleValueChange(e, i) {
@@ -1946,6 +1953,7 @@ class AXPDateTimeBoxWidgetEditComponent extends AXPValueWidgetComponent {
1946
1953
  this.setValue(newValues[0]);
1947
1954
  }
1948
1955
  }
1956
+ #effect;
1949
1957
  addItem() {
1950
1958
  const newValues = [...this.internalValue(), ''];
1951
1959
  this.setValue(newValues);
@@ -2055,7 +2063,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
2055
2063
  AXDateTimeBoxModule,
2056
2064
  AXButtonModule,
2057
2065
  AXDecoratorModule,
2058
- AXValidationModule
2066
+ AXValidationModule,
2059
2067
  ],
2060
2068
  inputs: [],
2061
2069
  }]