mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Fix issue #641
This removes the reference to the global moment function. A custom masking function must now accompany any custom formatter configured via setDateFormatter. This will prevent moment.js from breaking pages that use the default formatter.
This commit is contained in:
parent
892e2b8807
commit
f006e96b62
@ -2249,15 +2249,8 @@ var datetimepickerFactory = function ($) {
|
||||
}
|
||||
|
||||
if (options.mask === true) {
|
||||
if (typeof moment != 'undefined') {
|
||||
options.mask = options.format
|
||||
.replace(/Y{4}/g, '9999')
|
||||
.replace(/Y{2}/g, '99')
|
||||
.replace(/M{2}/g, '19')
|
||||
.replace(/D{2}/g, '39')
|
||||
.replace(/H{2}/g, '29')
|
||||
.replace(/m{2}/g, '59')
|
||||
.replace(/s{2}/g, '59');
|
||||
if (dateHelper.formatMask) {
|
||||
options.mask = dateHelper.formatMask(options.format)
|
||||
} else {
|
||||
options.mask = options.format
|
||||
.replace(/Y/g, '9999')
|
||||
|
Loading…
Reference in New Issue
Block a user