Skip to content

Commit

Permalink
Use core inputmask
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki committed Oct 27, 2023
1 parent b635b20 commit 6c19b06
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Source/Blazorise/wwwroot/datePicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./vendors/flatpickr.js?v=1.3.2.0";
import * as utilities from "./utilities.js?v=1.3.2.0";
import Inputmask from "./vendors/inputmask.js?v=1.3.2.0";
import * as inputmask from "./inputmask.js?v=1.3.2.0";

const _pickers = [];

Expand Down Expand Up @@ -54,7 +54,10 @@ export function initialize(dotnetAdapter, element, elementId, options) {
disable: options.disabledDates || [],
inline: options.inline || false,
disableMobile: options.disableMobile || true,
static: options.staticPicker
static: options.staticPicker,
errorHandler: (error) => {
// do nothing to prevent warnings in the console
}
};

if (options.selectionMode)
Expand Down Expand Up @@ -334,11 +337,10 @@ function setInputMask(picker, inputFormat) {
picker.inputMask.remove();
}

picker.inputMask = new Inputmask({
picker.inputMask = inputmask.initialize(null, picker.altInput, null, {
placeholder: inputFormat,
alias: "datetime",
inputFormat: inputFormat
});

picker.inputMask.mask(picker.altInput);
}
}

0 comments on commit 6c19b06

Please sign in to comment.