@magic-xpa/angular 4.1000.0-Time24h-dev4100.352 → 4.1000.0-Time24h-dev4100.353

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.
@@ -3301,6 +3301,17 @@ class MgformatMagicDirective {
3301
3301
  input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 7)}`;
3302
3302
  }
3303
3303
  }
3304
+ else if (this._task.mgInputDateFormat == "dd/MMM/yyyy" || this._task.mgInputDateFormat == "dd-MMM-yyyy") {
3305
+ if (value.length <= 2) {
3306
+ input.value = value;
3307
+ }
3308
+ else if (value.length <= 5) {
3309
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2)}`;
3310
+ }
3311
+ else {
3312
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 9)}`;
3313
+ }
3314
+ }
3304
3315
  else if (this._task.mgInputDateFormat == "yy/dd/MMM" || this._task.mgInputDateFormat == "yy-dd-MMM") {
3305
3316
  if (value.length <= 2) {
3306
3317
  input.value = value;
@@ -3346,6 +3357,14 @@ class MgformatMagicDirective {
3346
3357
  }
3347
3358
  }
3348
3359
  }
3360
+ if (cursorPos < input.value.length && input.value.length > this._task.mgInputDateFormat.length) {
3361
+ let inputDate = input.value;
3362
+ let start = input.selectionStart - 1;
3363
+ let end = input.selectionEnd - 1;
3364
+ let indexToRemove = input.selectionStart - 1;
3365
+ input.value = inputDate.slice(0, indexToRemove) + inputDate.slice(indexToRemove + 1);
3366
+ input.setSelectionRange(start, end);
3367
+ }
3349
3368
  }
3350
3369
  onChangeEvent($event) {
3351
3370
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);