techgarage-ir.MTWireGuard/UI/wwwroot/vendors/tempus/plugins/moment-parse.js
2023-06-28 18:24:44 +03:30

20 lines
No EOL
1.1 KiB
JavaScript

/*!
* Tempus Dominus v6.7.7 (https://getdatepicker.com/)
* Copyright 2013-2023 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(g.tempusDominus=g.tempusDominus||{},g.tempusDominus.plugins=g.tempusDominus.plugins||{},g.tempusDominus.plugins.moment_parse=f()));})(this,(function(){'use strict';var index = (option, tdClasses, tdFactory) => {
tdClasses.Dates.prototype.setFromInput = function (value, index) {
const converted = moment(value, option);
if (converted.isValid()) {
const date = tdFactory.DateTime.convert(converted.toDate(), this.optionsStore.options.localization.locale);
this.setValue(date, index);
}
else {
console.warn('Momentjs failed to parse the input date.');
}
};
tdClasses.Dates.prototype.formatInput = function (date) {
return moment(date).format(option);
};
};return index;}));