Bug fix in Basic class, add method to basic class, flatpickr add
- Bug in date/time check in Basic class. Time check was invalid - Add calcDaysInterval to get days between two dates plus weeki days and weekend days - Add flatpickr to replace datepickr and move datepickr init function into separate file (from edit.*.js)
This commit is contained in:
20
www/layout/admin/javascript/datepickr/datepickr.init.js
Executable file
20
www/layout/admin/javascript/datepickr/datepickr.init.js
Executable file
@@ -0,0 +1,20 @@
|
||||
/* only used for datepickr */
|
||||
|
||||
// METHOD: initDatepickr
|
||||
// PARAMS: initial date ID (#)
|
||||
// RETURN: true on ok, false on failure
|
||||
// DESC : inits date pickr which translations for dates (week/month)
|
||||
function initDatepickr(init_date)
|
||||
{
|
||||
if ($(init_date)) {
|
||||
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
||||
// dates in japanese
|
||||
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
||||
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
||||
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
||||
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -659,25 +659,6 @@ function html_options_refill(name, data, sort = '')
|
||||
}
|
||||
}
|
||||
|
||||
// METHOD: initDatepickr
|
||||
// PARAMS: initial date ID (#)
|
||||
// RETURN: true on ok, false on failure
|
||||
// DESC : inits date pickr which translations for dates (week/month)
|
||||
function initDatepickr(init_date)
|
||||
{
|
||||
if (document.getElementById(init_date)) {
|
||||
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
||||
// dates in japanese
|
||||
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
||||
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
||||
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
||||
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// *** MASTER logout call
|
||||
// METHOD: loginLogout
|
||||
// PARAMS: none
|
||||
|
||||
@@ -737,25 +737,6 @@ function html_options_refill(name, data, sort = '')
|
||||
}
|
||||
}
|
||||
|
||||
// METHOD: initDatepickr
|
||||
// PARAMS: initial date ID (#)
|
||||
// RETURN: true on ok, false on failure
|
||||
// DESC : inits date pickr which translations for dates (week/month)
|
||||
function initDatepickr(init_date)
|
||||
{
|
||||
if ($(init_date)) {
|
||||
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
||||
// dates in japanese
|
||||
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
||||
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
||||
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
||||
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// *** MASTER logout call
|
||||
// METHOD: loginLogout
|
||||
// PARAMS: none
|
||||
|
||||
66
www/layout/admin/javascript/flatpickr/flatpickr.ja.js
Normal file
66
www/layout/admin/javascript/flatpickr/flatpickr.ja.js
Normal file
@@ -0,0 +1,66 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.ja = {}));
|
||||
}(this, function (exports) { 'use strict';
|
||||
|
||||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
|
||||
? window.flatpickr
|
||||
: {
|
||||
l10ns: {}
|
||||
};
|
||||
var Japanese = {
|
||||
weekdays: {
|
||||
shorthand: ["日", "月", "火", "水", "木", "金", "土"],
|
||||
longhand: [
|
||||
"日曜日",
|
||||
"月曜日",
|
||||
"火曜日",
|
||||
"水曜日",
|
||||
"木曜日",
|
||||
"金曜日",
|
||||
"土曜日",
|
||||
]
|
||||
},
|
||||
months: {
|
||||
shorthand: [
|
||||
"1月",
|
||||
"2月",
|
||||
"3月",
|
||||
"4月",
|
||||
"5月",
|
||||
"6月",
|
||||
"7月",
|
||||
"8月",
|
||||
"9月",
|
||||
"10月",
|
||||
"11月",
|
||||
"12月",
|
||||
],
|
||||
longhand: [
|
||||
"1月",
|
||||
"2月",
|
||||
"3月",
|
||||
"4月",
|
||||
"5月",
|
||||
"6月",
|
||||
"7月",
|
||||
"8月",
|
||||
"9月",
|
||||
"10月",
|
||||
"11月",
|
||||
"12月",
|
||||
]
|
||||
},
|
||||
time_24hr: true,
|
||||
rangeSeparator: ' から '
|
||||
};
|
||||
fp.l10ns.ja = Japanese;
|
||||
var ja = fp.l10ns;
|
||||
|
||||
exports.Japanese = Japanese;
|
||||
exports.default = ja;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
13
www/layout/admin/javascript/flatpickr/flatpickr.min.css
vendored
Normal file
13
www/layout/admin/javascript/flatpickr/flatpickr.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
www/layout/admin/javascript/flatpickr/flatpickr.min.js
vendored
Normal file
2
www/layout/admin/javascript/flatpickr/flatpickr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user