diff --git a/bl-kernel/admin/controllers/dashboard.php b/bl-kernel/admin/controllers/dashboard.php
index d8643075..02b2edcc 100644
--- a/bl-kernel/admin/controllers/dashboard.php
+++ b/bl-kernel/admin/controllers/dashboard.php
@@ -3,88 +3,22 @@
// ============================================================================
// Functions
// ============================================================================
-// function updateBludit()
-// {
-// global $Site;
-// global $dbPosts;
-// global $dbPages;
+function updateBludit() {
+ global $Site;
+ // Check if Bludit need to be update.
+ if( ($Site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) ) {
+ Log::set('UPDATE SYSTEM - Starting.');
-// // Check if Bludit need to be update.
-// if( ($Site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) )
-// {
-// // LOG
-// Log::set('UPDATE SYSTEM - Starting...');
+ // From Bludit v2.0.x to v2.1.x
+ if ($Site->currentBuild() < '20171102') {
+ // Nothing to do
+ }
-// // LOG
-// Log::set('UPDATE SYSTEM - Checking posts.');
-
-// // Update posts
-// foreach($dbPosts->db as $key=>$post) {
-
-// // Dates
-// $date = Date::format($post['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
-// if($date !== false) {
-// $dbPosts->setPostDb($key, 'date', $date);
-// }
-
-// // Checksum
-// if( empty($post['md5file']) ) {
-// $checksum = md5_file(PATH_POSTS.$key.DS.FILENAME);
-// $dbPosts->setPostDb($key, 'md5file', $checksum);
-// }
-// }
-
-// $dbPosts->save();
-
-// // LOG
-// Log::set('UPDATE SYSTEM - Checking pages.');
-
-// // Update pages
-// foreach($dbPages->db as $key=>$page) {
-
-// $date = Date::format($page['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
-// if($date !== false) {
-// $dbPages->setField($key, 'date', $date);
-// }
-
-// // Checksum
-// if( empty($post['md5file']) ) {
-// $checksum = md5_file(PATH_PAGES.$key.DS.FILENAME);
-// $dbPages->setField($key, 'md5file', $checksum);
-// }
-// }
-
-// $dbPages->save();
-
-// // LOG
-// Log::set('UPDATE SYSTEM - Checking directories.');
-
-// // --- Update directories ---
-// $directories = array(
-// PATH_POSTS,
-// PATH_PAGES,
-// PATH_PLUGINS_DATABASES,
-// PATH_UPLOADS_PROFILES,
-// PATH_UPLOADS_THUMBNAILS,
-// PATH_TMP
-// );
-
-// foreach($directories as $dir) {
-
-// // Check if the directory is already created.
-// if(!file_exists($dir)) {
-// // Create the directory recursive.
-// mkdir($dir, DIR_PERMISSIONS, true);
-// }
-// }
-
-// // Set and save the database.
-// $Site->set(array('currentBuild'=>BLUDIT_BUILD));
-
-// // LOG
-// Log::set('UPDATE SYSTEM - Updated...');
-// }
-// }
+ // Set the current build number
+ $Site->set(array('currentBuild'=>BLUDIT_BUILD));
+ Log::set('UPDATE SYSTEM - Finished.');
+ }
+}
// ============================================================================
// Main before POST
@@ -99,7 +33,7 @@
// ============================================================================
// Try update Bludit
-//updateBludit();
+updateBludit();
// Title of the page
$layout['title'] .= ' - '.$Language->g('Dashboard');
\ No newline at end of file
diff --git a/bl-kernel/admin/themes/default/css/jquery.datetimepicker.css b/bl-kernel/admin/themes/default/css/jquery.datetimepicker.css
old mode 100644
new mode 100755
index beda1458..4ed981aa
--- a/bl-kernel/admin/themes/default/css/jquery.datetimepicker.css
+++ b/bl-kernel/admin/themes/default/css/jquery.datetimepicker.css
@@ -102,7 +102,7 @@
margin-bottom: 3px
}
-.xdsoft_datetimepicker .xdsoft_mounthpicker {
+.xdsoft_datetimepicker .xdsoft_monthpicker {
position: relative;
text-align: center;
}
diff --git a/bl-kernel/admin/themes/default/js/jquery.datetimepicker.js b/bl-kernel/admin/themes/default/js/jquery.datetimepicker.js
old mode 100644
new mode 100755
index 0a70b4c3..391a6af5
--- a/bl-kernel/admin/themes/default/js/jquery.datetimepicker.js
+++ b/bl-kernel/admin/themes/default/js/jquery.datetimepicker.js
@@ -1,2092 +1 @@
-/**
- * @preserve jQuery DateTimePicker plugin v2.4.5
- * @homepage http://xdsoft.net/jqplugins/datetimepicker/
- * (c) 2014, Chupurnov Valeriy.
- */
-/*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
-(function ($) {
- 'use strict';
- var default_options = {
- i18n: {
- ar: { // Arabic
- months: [
- "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
- ],
- dayOfWeek: [
- "ن", "ث", "ع", "خ", "ج", "س", "ح"
- ]
- },
- ro: { // Romanian
- months: [
- "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie"
- ],
- dayOfWeek: [
- "l", "ma", "mi", "j", "v", "s", "d"
- ]
- },
- id: { // Indonesian
- months: [
- "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
- ],
- dayOfWeek: [
- "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
- ]
- },
- is: { // Icelandic
- months: [
- "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"
- ],
- dayOfWeek: [
- "Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
- ]
- },
- bg: { // Bulgarian
- months: [
- "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
- ],
- dayOfWeek: [
- "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
- ]
- },
- fa: { // Persian/Farsi
- months: [
- 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
- ],
- dayOfWeek: [
- 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
- ]
- },
- ru: { // Russian
- months: [
- 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
- ],
- dayOfWeek: [
- "Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
- ]
- },
- uk: { // Ukrainian
- months: [
- 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
- ],
- dayOfWeek: [
- "Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
- ]
- },
- en: { // English
- months: [
- "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
- ],
- dayOfWeek: [
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
- ]
- },
- el: { // Ελληνικά
- months: [
- "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
- ],
- dayOfWeek: [
- "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
- ]
- },
- de: { // German
- months: [
- 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
- ],
- dayOfWeek: [
- "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
- ]
- },
- nl: { // Dutch
- months: [
- "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
- ],
- dayOfWeek: [
- "zo", "ma", "di", "wo", "do", "vr", "za"
- ]
- },
- tr: { // Turkish
- months: [
- "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
- ],
- dayOfWeek: [
- "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
- ]
- },
- fr: { //French
- months: [
- "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
- ],
- dayOfWeek: [
- "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
- ]
- },
- es: { // Spanish
- months: [
- "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
- ],
- dayOfWeek: [
- "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
- ]
- },
- th: { // Thai
- months: [
- 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
- ],
- dayOfWeek: [
- 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
- ]
- },
- pl: { // Polish
- months: [
- "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
- ],
- dayOfWeek: [
- "nd", "pn", "wt", "śr", "cz", "pt", "sb"
- ]
- },
- pt: { // Portuguese
- months: [
- "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
- ],
- dayOfWeek: [
- "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
- ]
- },
- ch: { // Simplified Chinese
- months: [
- "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
- ],
- dayOfWeek: [
- "日", "一", "二", "三", "四", "五", "六"
- ]
- },
- se: { // Swedish
- months: [
- "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
- ],
- dayOfWeek: [
- "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
- ]
- },
- kr: { // Korean
- months: [
- "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
- ],
- dayOfWeek: [
- "일", "월", "화", "수", "목", "금", "토"
- ]
- },
- it: { // Italian
- months: [
- "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
- ],
- dayOfWeek: [
- "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
- ]
- },
- da: { // Dansk
- months: [
- "January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
- ],
- dayOfWeek: [
- "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
- ]
- },
- no: { // Norwegian
- months: [
- "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
- ],
- dayOfWeek: [
- "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
- ]
- },
- ja: { // Japanese
- months: [
- "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
- ],
- dayOfWeek: [
- "日", "月", "火", "水", "木", "金", "土"
- ]
- },
- vi: { // Vietnamese
- months: [
- "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
- ],
- dayOfWeek: [
- "CN", "T2", "T3", "T4", "T5", "T6", "T7"
- ]
- },
- sl: { // Slovenščina
- months: [
- "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
- ],
- dayOfWeek: [
- "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
- ]
- },
- cs: { // Čeština
- months: [
- "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
- ],
- dayOfWeek: [
- "Ne", "Po", "Út", "St", "Čt", "Pá", "So"
- ]
- },
- hu: { // Hungarian
- months: [
- "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
- ],
- dayOfWeek: [
- "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
- ]
- },
- az: { //Azerbaijanian (Azeri)
- months: [
- "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
- ],
- dayOfWeek: [
- "B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
- ]
- },
- bs: { //Bosanski
- months: [
- "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
- ],
- dayOfWeek: [
- "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
- ]
- },
- ca: { //Català
- months: [
- "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
- ],
- dayOfWeek: [
- "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
- ]
- },
- 'en-GB': { //English (British)
- months: [
- "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
- ],
- dayOfWeek: [
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
- ]
- },
- et: { //"Eesti"
- months: [
- "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
- ],
- dayOfWeek: [
- "P", "E", "T", "K", "N", "R", "L"
- ]
- },
- eu: { //Euskara
- months: [
- "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
- ],
- dayOfWeek: [
- "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
- ]
- },
- fi: { //Finnish (Suomi)
- months: [
- "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
- ],
- dayOfWeek: [
- "Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
- ]
- },
- gl: { //Galego
- months: [
- "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
- ],
- dayOfWeek: [
- "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
- ]
- },
- hr: { //Hrvatski
- months: [
- "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
- ],
- dayOfWeek: [
- "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
- ]
- },
- ko: { //Korean (한국어)
- months: [
- "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
- ],
- dayOfWeek: [
- "일", "월", "화", "수", "목", "금", "토"
- ]
- },
- lt: { //Lithuanian (lietuvių)
- months: [
- "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
- ],
- dayOfWeek: [
- "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
- ]
- },
- lv: { //Latvian (Latviešu)
- months: [
- "Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
- ],
- dayOfWeek: [
- "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
- ]
- },
- mk: { //Macedonian (Македонски)
- months: [
- "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
- ],
- dayOfWeek: [
- "нед", "пон", "вто", "сре", "чет", "пет", "саб"
- ]
- },
- mn: { //Mongolian (Монгол)
- months: [
- "1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
- ],
- dayOfWeek: [
- "Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
- ]
- },
- 'pt-BR': { //Português(Brasil)
- months: [
- "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
- ],
- dayOfWeek: [
- "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
- ]
- },
- sk: { //Slovenčina
- months: [
- "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
- ],
- dayOfWeek: [
- "Ne", "Po", "Ut", "St", "Št", "Pi", "So"
- ]
- },
- sq: { //Albanian (Shqip)
- months: [
- "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
- ],
- dayOfWeek: [
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
- ]
- },
- 'sr-YU': { //Serbian (Srpski)
- months: [
- "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
- ],
- dayOfWeek: [
- "Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
- ]
- },
- sr: { //Serbian Cyrillic (Српски)
- months: [
- "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
- ],
- dayOfWeek: [
- "нед", "пон", "уто", "сре", "чет", "пет", "суб"
- ]
- },
- sv: { //Svenska
- months: [
- "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
- ],
- dayOfWeek: [
- "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
- ]
- },
- 'zh-TW': { //Traditional Chinese (繁體中文)
- months: [
- "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
- ],
- dayOfWeek: [
- "日", "一", "二", "三", "四", "五", "六"
- ]
- },
- zh: { //Simplified Chinese (简体中文)
- months: [
- "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
- ],
- dayOfWeek: [
- "日", "一", "二", "三", "四", "五", "六"
- ]
- },
- he: { //Hebrew (עברית)
- months: [
- 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
- ],
- dayOfWeek: [
- 'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
- ]
- },
- hy: { // Armenian
- months: [
- "Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
- ],
- dayOfWeek: [
- "Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
- ]
- },
- kg: { // Kyrgyz
- months: [
- 'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
- ],
- dayOfWeek: [
- "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
- ]
- }
- },
- value: '',
- lang: 'en',
- rtl: false,
-
- format: 'Y/m/d H:i',
- formatTime: 'H:i',
- formatDate: 'Y/m/d',
-
- startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
- step: 60,
- monthChangeSpinner: true,
-
- closeOnDateSelect: false,
- closeOnTimeSelect: true,
- closeOnWithoutClick: true,
- closeOnInputClick: true,
-
- timepicker: true,
- datepicker: true,
- weeks: false,
-
- defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i')
- defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
-
- minDate: false,
- maxDate: false,
- minTime: false,
- maxTime: false,
- disabledMinTime: false,
- disabledMaxTime: false,
-
- allowTimes: [],
- opened: false,
- initTime: true,
- inline: false,
- theme: '',
-
- onSelectDate: function () {},
- onSelectTime: function () {},
- onChangeMonth: function () {},
- onChangeYear: function () {},
- onChangeDateTime: function () {},
- onShow: function () {},
- onClose: function () {},
- onGenerate: function () {},
-
- withoutCopyright: true,
- inverseButton: false,
- hours12: false,
- next: 'xdsoft_next',
- prev : 'xdsoft_prev',
- dayOfWeekStart: 0,
- parentID: 'body',
- timeHeightInTimePicker: 25,
- timepickerScrollbar: true,
- todayButton: true,
- prevButton: true,
- nextButton: true,
- defaultSelect: true,
-
- scrollMonth: true,
- scrollTime: true,
- scrollInput: true,
-
- lazyInit: false,
- mask: false,
- validateOnBlur: true,
- allowBlank: true,
- yearStart: 1950,
- yearEnd: 2050,
- monthStart: 0,
- monthEnd: 11,
- style: '',
- id: '',
- fixed: false,
- roundTime: 'round', // ceil, floor
- className: '',
- weekends: [],
- highlightedDates: [],
- highlightedPeriods: [],
- disabledDates : [],
- disabledWeekDays: [],
- yearOffset: 0,
- beforeShowDay: null,
-
- enterLikeTab: true,
- showApplyButton: false
- };
- // fix for ie8
- if (!window.getComputedStyle) {
- window.getComputedStyle = function (el, pseudo) {
- this.el = el;
- this.getPropertyValue = function (prop) {
- var re = /(\-([a-z]){1})/g;
- if (prop === 'float') {
- prop = 'styleFloat';
- }
- if (re.test(prop)) {
- prop = prop.replace(re, function (a, b, c) {
- return c.toUpperCase();
- });
- }
- return el.currentStyle[prop] || null;
- };
- return this;
- };
- }
- if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function (obj, start) {
- var i, j;
- for (i = (start || 0), j = this.length; i < j; i += 1) {
- if (this[i] === obj) { return i; }
- }
- return -1;
- };
- }
- Date.prototype.countDaysInMonth = function () {
- return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
- };
- $.fn.xdsoftScroller = function (percent) {
- return this.each(function () {
- var timeboxparent = $(this),
- pointerEventToXY = function (e) {
- var out = {x: 0, y: 0},
- touch;
- if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
- touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
- out.x = touch.clientX;
- out.y = touch.clientY;
- } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
- out.x = e.clientX;
- out.y = e.clientY;
- }
- return out;
- },
- move = 0,
- timebox,
- parentHeight,
- height,
- scrollbar,
- scroller,
- maximumOffset = 100,
- start = false,
- startY = 0,
- startTop = 0,
- h1 = 0,
- touchStart = false,
- startTopScroll = 0,
- calcOffset = function () {};
- if (percent === 'hide') {
- timeboxparent.find('.xdsoft_scrollbar').hide();
- return;
- }
- if (!$(this).hasClass('xdsoft_scroller_box')) {
- timebox = timeboxparent.children().eq(0);
- parentHeight = timeboxparent[0].clientHeight;
- height = timebox[0].offsetHeight;
- scrollbar = $('
');
- scroller = $('');
- scrollbar.append(scroller);
-
- timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
- calcOffset = function calcOffset(event) {
- var offset = pointerEventToXY(event).y - startY + startTopScroll;
- if (offset < 0) {
- offset = 0;
- }
- if (offset + scroller[0].offsetHeight > h1) {
- offset = h1 - scroller[0].offsetHeight;
- }
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
- };
-
- scroller
- .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
- if (!parentHeight) {
- timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
- }
-
- startY = pointerEventToXY(event).y;
- startTopScroll = parseInt(scroller.css('margin-top'), 10);
- h1 = scrollbar[0].offsetHeight;
-
- if (event.type === 'mousedown') {
- if (document) {
- $(document.body).addClass('xdsoft_noselect');
- }
- $([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() {
- $([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee)
- .off('mousemove.xdsoft_scroller', calcOffset)
- .removeClass('xdsoft_noselect');
- });
- $(document.body).on('mousemove.xdsoft_scroller', calcOffset);
- } else {
- touchStart = true;
- event.stopPropagation();
- event.preventDefault();
- }
- })
- .on('touchmove', function (event) {
- if (touchStart) {
- event.preventDefault();
- calcOffset(event);
- }
- })
- .on('touchend touchcancel', function (event) {
- touchStart = false;
- startTopScroll = 0;
- });
-
- timeboxparent
- .on('scroll_element.xdsoft_scroller', function (event, percentage) {
- if (!parentHeight) {
- timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
- }
- percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
-
- scroller.css('margin-top', maximumOffset * percentage);
-
- setTimeout(function () {
- timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
- }, 10);
- })
- .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
- var percent, sh;
- parentHeight = timeboxparent[0].clientHeight;
- height = timebox[0].offsetHeight;
- percent = parentHeight / height;
- sh = percent * scrollbar[0].offsetHeight;
- if (percent > 1) {
- scroller.hide();
- } else {
- scroller.show();
- scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
- maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
- if (noTriggerScroll !== true) {
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
- }
- }
- });
-
- timeboxparent.on('mousewheel', function (event) {
- var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
-
- top = top - (event.deltaY * 20);
- if (top < 0) {
- top = 0;
- }
-
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
- event.stopPropagation();
- return false;
- });
-
- timeboxparent.on('touchstart', function (event) {
- start = pointerEventToXY(event);
- startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
- });
-
- timeboxparent.on('touchmove', function (event) {
- if (start) {
- event.preventDefault();
- var coord = pointerEventToXY(event);
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
- }
- });
-
- timeboxparent.on('touchend touchcancel', function (event) {
- start = false;
- startTop = 0;
- });
- }
- timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
- });
- };
-
- $.fn.datetimepicker = function (opt) {
- var KEY0 = 48,
- KEY9 = 57,
- _KEY0 = 96,
- _KEY9 = 105,
- CTRLKEY = 17,
- DEL = 46,
- ENTER = 13,
- ESC = 27,
- BACKSPACE = 8,
- ARROWLEFT = 37,
- ARROWUP = 38,
- ARROWRIGHT = 39,
- ARROWDOWN = 40,
- TAB = 9,
- F5 = 116,
- AKEY = 65,
- CKEY = 67,
- VKEY = 86,
- ZKEY = 90,
- YKEY = 89,
- ctrlDown = false,
- options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
-
- lazyInitTimer = 0,
- createDateTimePicker,
- destroyDateTimePicker,
-
- lazyInit = function (input) {
- input
- .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) {
- if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
- return;
- }
- clearTimeout(lazyInitTimer);
- lazyInitTimer = setTimeout(function () {
-
- if (!input.data('xdsoft_datetimepicker')) {
- createDateTimePicker(input);
- }
- input
- .off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback)
- .trigger('open.xdsoft');
- }, 100);
- });
- };
-
- createDateTimePicker = function (input) {
- var datetimepicker = $(''),
- xdsoft_copyright = $(''),
- datepicker = $(''),
- mounth_picker = $(''),
- calendar = $(''),
- timepicker = $(''),
- timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
- timebox = $(''),
- applyButton = $(''),
- /*scrollbar = $(''),
- scroller = $(''),*/
- monthselect = $(''),
- yearselect = $(''),
- triggerAfterOpen = false,
- XDSoft_datetime,
- //scroll_element,
- xchangeTimer,
- timerclick,
- current_time_index,
- setPos,
- timer = 0,
- timer1 = 0,
- _xdsoft_datetime;
-
- if (options.id) {
- datetimepicker.attr('id', options.id);
- }
- if (options.style) {
- datetimepicker.attr('style', options.style);
- }
- if (options.weeks) {
- datetimepicker.addClass('xdsoft_showweeks');
- }
- if (options.rtl) {
- datetimepicker.addClass('xdsoft_rtl');
- }
-
- datetimepicker.addClass('xdsoft_' + options.theme);
- datetimepicker.addClass(options.className);
-
- mounth_picker
- .find('.xdsoft_month span')
- .after(monthselect);
- mounth_picker
- .find('.xdsoft_year span')
- .after(yearselect);
-
- mounth_picker
- .find('.xdsoft_month,.xdsoft_year')
- .on('mousedown.xdsoft', function (event) {
- var select = $(this).find('.xdsoft_select').eq(0),
- val = 0,
- top = 0,
- visible = select.is(':visible'),
- items,
- i;
-
- mounth_picker
- .find('.xdsoft_select')
- .hide();
- if (_xdsoft_datetime.currentTime) {
- val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
- }
-
- select[visible ? 'hide' : 'show']();
- for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
- if (items.eq(i).data('value') === val) {
- break;
- } else {
- top += items[0].offsetHeight;
- }
- }
-
- select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
- event.stopPropagation();
- return false;
- });
-
- mounth_picker
- .find('.xdsoft_select')
- .xdsoftScroller()
- .on('mousedown.xdsoft', function (event) {
- event.stopPropagation();
- event.preventDefault();
- })
- .on('mousedown.xdsoft', '.xdsoft_option', function (event) {
-
- if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
- _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
- }
-
- var year = _xdsoft_datetime.currentTime.getFullYear();
- if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
- _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
- }
-
- $(this).parent().parent().hide();
-
- datetimepicker.trigger('xchange.xdsoft');
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
- options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
-
- if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
- options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
- });
-
- datetimepicker.setOptions = function (_options) {
- var highlightedDates = {},
- getCaretPos = function (input) {
- try {
- if (document.selection && document.selection.createRange) {
- var range = document.selection.createRange();
- return range.getBookmark().charCodeAt(2) - 2;
- }
- if (input.setSelectionRange) {
- return input.selectionStart;
- }
- } catch (e) {
- return 0;
- }
- },
- setCaretPos = function (node, pos) {
- node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
- if (!node) {
- return false;
- }
- if (node.createTextRange) {
- var textRange = node.createTextRange();
- textRange.collapse(true);
- textRange.moveEnd('character', pos);
- textRange.moveStart('character', pos);
- textRange.select();
- return true;
- }
- if (node.setSelectionRange) {
- node.setSelectionRange(pos, pos);
- return true;
- }
- return false;
- },
- isValidValue = function (mask, value) {
- var reg = mask
- .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
- .replace(/_/g, '{digit+}')
- .replace(/([0-9]{1})/g, '{digit$1}')
- .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
- .replace(/\{digit[\+]\}/g, '[0-9_]{1}');
- return (new RegExp(reg)).test(value);
- };
- options = $.extend(true, {}, options, _options);
-
- if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
- options.allowTimes = $.extend(true, [], _options.allowTimes);
- }
-
- if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
- options.weekends = $.extend(true, [], _options.weekends);
- }
-
- if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
- $.each(_options.highlightedDates, function (index, value) {
- var splitData = $.map(value.split(','), $.trim),
- exDesc,
- hDate = new HighlightedDate(Date.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
- keyDate = hDate.date.dateFormat(options.formatDate);
- if (highlightedDates[keyDate] !== undefined) {
- exDesc = highlightedDates[keyDate].desc;
- if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
- highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
- }
- } else {
- highlightedDates[keyDate] = hDate;
- }
- });
-
- options.highlightedDates = $.extend(true, [], highlightedDates);
- }
-
- if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
- highlightedDates = $.extend(true, [], options.highlightedDates);
- $.each(_options.highlightedPeriods, function (index, value) {
- var dateTest, // start date
- dateEnd,
- desc,
- hDate,
- keyDate,
- exDesc,
- style;
- if ($.isArray(value)) {
- dateTest = value[0];
- dateEnd = value[1];
- desc = value[2];
- style = value[3];
- }
- else {
- var splitData = $.map(value.split(','), $.trim);
- dateTest = Date.parseDate(splitData[0], options.formatDate);
- dateEnd = Date.parseDate(splitData[1], options.formatDate);
- desc = splitData[2];
- style = splitData[3];
- }
-
- while (dateTest <= dateEnd) {
- hDate = new HighlightedDate(dateTest, desc, style);
- keyDate = dateTest.dateFormat(options.formatDate);
- dateTest.setDate(dateTest.getDate() + 1);
- if (highlightedDates[keyDate] !== undefined) {
- exDesc = highlightedDates[keyDate].desc;
- if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
- highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
- }
- } else {
- highlightedDates[keyDate] = hDate;
- }
- }
- });
-
- options.highlightedDates = $.extend(true, [], highlightedDates);
- }
-
- if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
- options.disabledDates = $.extend(true, [], _options.disabledDates);
- }
-
- if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
- options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
- }
-
- if ((options.open || options.opened) && (!options.inline)) {
- input.trigger('open.xdsoft');
- }
-
- if (options.inline) {
- triggerAfterOpen = true;
- datetimepicker.addClass('xdsoft_inline');
- input.after(datetimepicker).hide();
- }
-
- if (options.inverseButton) {
- options.next = 'xdsoft_prev';
- options.prev = 'xdsoft_next';
- }
-
- if (options.datepicker) {
- datepicker.addClass('active');
- } else {
- datepicker.removeClass('active');
- }
-
- if (options.timepicker) {
- timepicker.addClass('active');
- } else {
- timepicker.removeClass('active');
- }
-
- if (options.value) {
- _xdsoft_datetime.setCurrentTime(options.value);
- if (input && input.val) {
- input.val(_xdsoft_datetime.str);
- }
- }
-
- if (isNaN(options.dayOfWeekStart)) {
- options.dayOfWeekStart = 0;
- } else {
- options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
- }
-
- if (!options.timepickerScrollbar) {
- timeboxparent.xdsoftScroller('hide');
- }
-
- if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
- options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate);
- }
-
- if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
- options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate);
- }
-
- applyButton.toggle(options.showApplyButton);
-
- mounth_picker
- .find('.xdsoft_today_button')
- .css('visibility', !options.todayButton ? 'hidden' : 'visible');
-
- mounth_picker
- .find('.' + options.prev)
- .css('visibility', !options.prevButton ? 'hidden' : 'visible');
-
- mounth_picker
- .find('.' + options.next)
- .css('visibility', !options.nextButton ? 'hidden' : 'visible');
-
- if (options.mask) {
- input.off('keydown.xdsoft');
-
- if (options.mask === true) {
- options.mask = options.format
- .replace(/Y/g, '9999')
- .replace(/F/g, '9999')
- .replace(/m/g, '19')
- .replace(/d/g, '39')
- .replace(/H/g, '29')
- .replace(/i/g, '59')
- .replace(/s/g, '59');
- }
-
- if ($.type(options.mask) === 'string') {
- if (!isValidValue(options.mask, input.val())) {
- input.val(options.mask.replace(/[0-9]/g, '_'));
- }
-
- input.on('keydown.xdsoft', function (event) {
- var val = this.value,
- key = event.which,
- pos,
- digit;
-
- if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
- pos = getCaretPos(this);
- digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
-
- if ((key === BACKSPACE || key === DEL) && pos) {
- pos -= 1;
- digit = '_';
- }
-
- while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
- pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
- }
-
- val = val.substr(0, pos) + digit + val.substr(pos + 1);
- if ($.trim(val) === '') {
- val = options.mask.replace(/[0-9]/g, '_');
- } else {
- if (pos === options.mask.length) {
- event.preventDefault();
- return false;
- }
- }
-
- pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
- while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
- pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
- }
-
- if (isValidValue(options.mask, val)) {
- this.value = val;
- setCaretPos(this, pos);
- } else if ($.trim(val) === '') {
- this.value = options.mask.replace(/[0-9]/g, '_');
- } else {
- input.trigger('error_input.xdsoft');
- }
- } else {
- if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
- return true;
- }
- }
-
- event.preventDefault();
- return false;
- });
- }
- }
- if (options.validateOnBlur) {
- input
- .off('blur.xdsoft')
- .on('blur.xdsoft', function () {
- if (options.allowBlank && !$.trim($(this).val()).length) {
- $(this).val(null);
- datetimepicker.data('xdsoft_datetime').empty();
- } else if (!Date.parseDate($(this).val(), options.format)) {
- var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')),
- splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
-
- // parse the numbers as 0312 => 03:12
- if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
- $(this).val([splittedHours, splittedMinutes].map(function (item) {
- return item > 9 ? item : '0' + item;
- }).join(':'));
- } else {
- $(this).val((_xdsoft_datetime.now()).dateFormat(options.format));
- }
-
- datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
- } else {
- datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
- }
-
- datetimepicker.trigger('changedatetime.xdsoft');
- });
- }
- options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
-
- datetimepicker
- .trigger('xchange.xdsoft')
- .trigger('afterOpen.xdsoft');
- };
-
- datetimepicker
- .data('options', options)
- .on('mousedown.xdsoft', function (event) {
- event.stopPropagation();
- event.preventDefault();
- yearselect.hide();
- monthselect.hide();
- return false;
- });
-
- //scroll_element = timepicker.find('.xdsoft_time_box');
- timeboxparent.append(timebox);
- timeboxparent.xdsoftScroller();
-
- datetimepicker.on('afterOpen.xdsoft', function () {
- timeboxparent.xdsoftScroller();
- });
-
- datetimepicker
- .append(datepicker)
- .append(timepicker);
-
- if (options.withoutCopyright !== true) {
- datetimepicker
- .append(xdsoft_copyright);
- }
-
- datepicker
- .append(mounth_picker)
- .append(calendar)
- .append(applyButton);
-
- $(options.parentID)
- .append(datetimepicker);
-
- XDSoft_datetime = function () {
- var _this = this;
- _this.now = function (norecursion) {
- var d = new Date(),
- date,
- time;
-
- if (!norecursion && options.defaultDate) {
- date = _this.strToDateTime(options.defaultDate);
- d.setFullYear(date.getFullYear());
- d.setMonth(date.getMonth());
- d.setDate(date.getDate());
- }
-
- if (options.yearOffset) {
- d.setFullYear(d.getFullYear() + options.yearOffset);
- }
-
- if (!norecursion && options.defaultTime) {
- time = _this.strtotime(options.defaultTime);
- d.setHours(time.getHours());
- d.setMinutes(time.getMinutes());
- }
- return d;
- };
-
- _this.isValidDate = function (d) {
- if (Object.prototype.toString.call(d) !== "[object Date]") {
- return false;
- }
- return !isNaN(d.getTime());
- };
-
- _this.setCurrentTime = function (dTime) {
- _this.currentTime = (typeof dTime === 'string') ? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime : _this.now();
- datetimepicker.trigger('xchange.xdsoft');
- };
-
- _this.empty = function () {
- _this.currentTime = null;
- };
-
- _this.getCurrentTime = function (dTime) {
- return _this.currentTime;
- };
-
- _this.nextMonth = function () {
-
- if (_this.currentTime === undefined || _this.currentTime === null) {
- _this.currentTime = _this.now();
- }
-
- var month = _this.currentTime.getMonth() + 1,
- year;
- if (month === 12) {
- _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
- month = 0;
- }
-
- year = _this.currentTime.getFullYear();
-
- _this.currentTime.setDate(
- Math.min(
- new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
- _this.currentTime.getDate()
- )
- );
- _this.currentTime.setMonth(month);
-
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
- options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
-
- if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
- options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
-
- datetimepicker.trigger('xchange.xdsoft');
- return month;
- };
-
- _this.prevMonth = function () {
-
- if (_this.currentTime === undefined || _this.currentTime === null) {
- _this.currentTime = _this.now();
- }
-
- var month = _this.currentTime.getMonth() - 1;
- if (month === -1) {
- _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
- month = 11;
- }
- _this.currentTime.setDate(
- Math.min(
- new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
- _this.currentTime.getDate()
- )
- );
- _this.currentTime.setMonth(month);
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
- options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
- datetimepicker.trigger('xchange.xdsoft');
- return month;
- };
-
- _this.getWeekOfYear = function (datetime) {
- var onejan = new Date(datetime.getFullYear(), 0, 1);
- return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
- };
-
- _this.strToDateTime = function (sDateTime) {
- var tmpDate = [], timeOffset, currentTime;
-
- if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
- return sDateTime;
- }
-
- tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
- if (tmpDate) {
- tmpDate[2] = Date.parseDate(tmpDate[2], options.formatDate);
- }
- if (tmpDate && tmpDate[2]) {
- timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
- currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
- } else {
- currentTime = sDateTime ? Date.parseDate(sDateTime, options.format) : _this.now();
- }
-
- if (!_this.isValidDate(currentTime)) {
- currentTime = _this.now();
- }
-
- return currentTime;
- };
-
- _this.strToDate = function (sDate) {
- if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
- return sDate;
- }
-
- var currentTime = sDate ? Date.parseDate(sDate, options.formatDate) : _this.now(true);
- if (!_this.isValidDate(currentTime)) {
- currentTime = _this.now(true);
- }
- return currentTime;
- };
-
- _this.strtotime = function (sTime) {
- if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
- return sTime;
- }
- var currentTime = sTime ? Date.parseDate(sTime, options.formatTime) : _this.now(true);
- if (!_this.isValidDate(currentTime)) {
- currentTime = _this.now(true);
- }
- return currentTime;
- };
-
- _this.str = function () {
- return _this.currentTime.dateFormat(options.format);
- };
- _this.currentTime = this.now();
- };
-
- _xdsoft_datetime = new XDSoft_datetime();
-
- applyButton.on('click', function (e) {//pathbrite
- e.preventDefault();
- datetimepicker.data('changed', true);
- _xdsoft_datetime.setCurrentTime(getCurrentValue());
- input.val(_xdsoft_datetime.str());
- datetimepicker.trigger('close.xdsoft');
- });
- mounth_picker
- .find('.xdsoft_today_button')
- .on('mousedown.xdsoft', function () {
- datetimepicker.data('changed', true);
- _xdsoft_datetime.setCurrentTime(0);
- datetimepicker.trigger('afterOpen.xdsoft');
- }).on('dblclick.xdsoft', function () {
- var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
- currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
- minDate = _xdsoft_datetime.strToDate(options.minDate);
- minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
- if (currentDate < minDate) {
- return;
- }
- maxDate = _xdsoft_datetime.strToDate(options.maxDate);
- maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
- if (currentDate > maxDate) {
- return;
- }
- input.val(_xdsoft_datetime.str());
- input.trigger('change');
- datetimepicker.trigger('close.xdsoft');
- });
- mounth_picker
- .find('.xdsoft_prev,.xdsoft_next')
- .on('mousedown.xdsoft', function () {
- var $this = $(this),
- timer = 0,
- stop = false;
-
- (function arguments_callee1(v) {
- if ($this.hasClass(options.next)) {
- _xdsoft_datetime.nextMonth();
- } else if ($this.hasClass(options.prev)) {
- _xdsoft_datetime.prevMonth();
- }
- if (options.monthChangeSpinner) {
- if (!stop) {
- timer = setTimeout(arguments_callee1, v || 100);
- }
- }
- }(500));
-
- $([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() {
- clearTimeout(timer);
- stop = true;
- $([document.body, window]).off('mouseup.xdsoft', arguments_callee2);
- });
- });
-
- timepicker
- .find('.xdsoft_prev,.xdsoft_next')
- .on('mousedown.xdsoft', function () {
- var $this = $(this),
- timer = 0,
- stop = false,
- period = 110;
- (function arguments_callee4(v) {
- var pheight = timeboxparent[0].clientHeight,
- height = timebox[0].offsetHeight,
- top = Math.abs(parseInt(timebox.css('marginTop'), 10));
- if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
- timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
- } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
- timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
- }
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox.css('marginTop'), 10) / (height - pheight))]);
- period = (period > 10) ? 10 : period - 10;
- if (!stop) {
- timer = setTimeout(arguments_callee4, v || period);
- }
- }(500));
- $([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() {
- clearTimeout(timer);
- stop = true;
- $([document.body, window])
- .off('mouseup.xdsoft', arguments_callee5);
- });
- });
-
- xchangeTimer = 0;
- // base handler - generating a calendar and timepicker
- datetimepicker
- .on('xchange.xdsoft', function (event) {
- clearTimeout(xchangeTimer);
- xchangeTimer = setTimeout(function () {
-
- if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
- _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
- }
-
- var table = '',
- start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
- i = 0,
- j,
- today = _xdsoft_datetime.now(),
- maxDate = false,
- minDate = false,
- hDate,
- day,
- d,
- y,
- m,
- w,
- classes = [],
- customDateSettings,
- newRow = true,
- time = '',
- h = '',
- line_time,
- description;
-
- while (start.getDay() !== options.dayOfWeekStart) {
- start.setDate(start.getDate() - 1);
- }
-
- table += '';
-
- if (options.weeks) {
- table += ' | ';
- }
-
- for (j = 0; j < 7; j += 1) {
- table += '' + options.i18n[options.lang].dayOfWeek[(j + options.dayOfWeekStart) % 7] + ' | ';
- }
-
- table += '
';
- table += '';
-
- if (options.maxDate !== false) {
- maxDate = _xdsoft_datetime.strToDate(options.maxDate);
- maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
- }
-
- if (options.minDate !== false) {
- minDate = _xdsoft_datetime.strToDate(options.minDate);
- minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
- }
-
- while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
- classes = [];
- i += 1;
-
- day = start.getDay();
- d = start.getDate();
- y = start.getFullYear();
- m = start.getMonth();
- w = _xdsoft_datetime.getWeekOfYear(start);
- description = '';
-
- classes.push('xdsoft_date');
-
- if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
- customDateSettings = options.beforeShowDay.call(datetimepicker, start);
- } else {
- customDateSettings = null;
- }
-
- if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
- classes.push('xdsoft_disabled');
- } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
- classes.push('xdsoft_disabled');
- } else if (options.disabledWeekDays.indexOf(day) !== -1) {
- classes.push('xdsoft_disabled');
- }
-
- if (customDateSettings && customDateSettings[1] !== "") {
- classes.push(customDateSettings[1]);
- }
-
- if (_xdsoft_datetime.currentTime.getMonth() !== m) {
- classes.push('xdsoft_other_month');
- }
-
- if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
- classes.push('xdsoft_current');
- }
-
- if (today.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
- classes.push('xdsoft_today');
- }
-
- if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(start.dateFormat(options.formatDate)) !== -1) {
- classes.push('xdsoft_weekend');
- }
-
- if (options.highlightedDates[start.dateFormat(options.formatDate)] !== undefined) {
- hDate = options.highlightedDates[start.dateFormat(options.formatDate)];
- classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
- description = hDate.desc === undefined ? '' : hDate.desc;
- }
-
- if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
- classes.push(options.beforeShowDay(start));
- }
-
- if (newRow) {
- table += '';
- newRow = false;
- if (options.weeks) {
- table += '' + w + ' | ';
- }
- }
-
- table += '' +
- ' ' + d + ' ' +
- ' | ';
-
- if (start.getDay() === options.dayOfWeekStartPrev) {
- table += '
';
- newRow = true;
- }
-
- start.setDate(d + 1);
- }
- table += '
';
-
- calendar.html(table);
-
- mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]);
- mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
-
- // generate timebox
- time = '';
- h = '';
- m = '';
- line_time = function line_time(h, m) {
- var now = _xdsoft_datetime.now(), optionDateTime, current_time;
- now.setHours(h);
- h = parseInt(now.getHours(), 10);
- now.setMinutes(m);
- m = parseInt(now.getMinutes(), 10);
- optionDateTime = new Date(_xdsoft_datetime.currentTime);
- optionDateTime.setHours(h);
- optionDateTime.setMinutes(m);
- classes = [];
- if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
- classes.push('xdsoft_disabled');
- }
- if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
- classes.push('xdsoft_disabled');
- }
-
- current_time = new Date(_xdsoft_datetime.currentTime);
- current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
- current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
-
- if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) {
- if (options.defaultSelect || datetimepicker.data('changed')) {
- classes.push('xdsoft_current');
- } else if (options.initTime) {
- classes.push('xdsoft_init_time');
- }
- }
- if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
- classes.push('xdsoft_today');
- }
- time += '' + now.dateFormat(options.formatTime) + '
';
- };
-
- if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
- for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
- for (j = 0; j < 60; j += options.step) {
- h = (i < 10 ? '0' : '') + i;
- m = (j < 10 ? '0' : '') + j;
- line_time(h, m);
- }
- }
- } else {
- for (i = 0; i < options.allowTimes.length; i += 1) {
- h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
- m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
- line_time(h, m);
- }
- }
-
- timebox.html(time);
-
- opt = '';
- i = 0;
-
- for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
- opt += '' + i + '
';
- }
- yearselect.children().eq(0)
- .html(opt);
-
- for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
- opt += '' + options.i18n[options.lang].months[i] + '
';
- }
- monthselect.children().eq(0).html(opt);
- $(datetimepicker)
- .trigger('generate.xdsoft');
- }, 10);
- event.stopPropagation();
- })
- .on('afterOpen.xdsoft', function () {
- if (options.timepicker) {
- var classType, pheight, height, top;
- if (timebox.find('.xdsoft_current').length) {
- classType = '.xdsoft_current';
- } else if (timebox.find('.xdsoft_init_time').length) {
- classType = '.xdsoft_init_time';
- }
- if (classType) {
- pheight = timeboxparent[0].clientHeight;
- height = timebox[0].offsetHeight;
- top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
- if ((height - pheight) < top) {
- top = height - pheight;
- }
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
- } else {
- timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
- }
- }
- });
-
- timerclick = 0;
- calendar
- .on('click.xdsoft', 'td', function (xdevent) {
- xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
- timerclick += 1;
- var $this = $(this),
- currentTime = _xdsoft_datetime.currentTime;
-
- if (currentTime === undefined || currentTime === null) {
- _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
- currentTime = _xdsoft_datetime.currentTime;
- }
-
- if ($this.hasClass('xdsoft_disabled')) {
- return false;
- }
-
- currentTime.setDate(1);
- currentTime.setFullYear($this.data('year'));
- currentTime.setMonth($this.data('month'));
- currentTime.setDate($this.data('date'));
-
- datetimepicker.trigger('select.xdsoft', [currentTime]);
-
- input.val(_xdsoft_datetime.str());
- if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
- datetimepicker.trigger('close.xdsoft');
- }
-
- if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
- options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
- }
-
- datetimepicker.data('changed', true);
- datetimepicker.trigger('xchange.xdsoft');
- datetimepicker.trigger('changedatetime.xdsoft');
- setTimeout(function () {
- timerclick = 0;
- }, 200);
- });
-
- timebox
- .on('click.xdsoft', 'div', function (xdevent) {
- xdevent.stopPropagation();
- var $this = $(this),
- currentTime = _xdsoft_datetime.currentTime;
-
- if (currentTime === undefined || currentTime === null) {
- _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
- currentTime = _xdsoft_datetime.currentTime;
- }
-
- if ($this.hasClass('xdsoft_disabled')) {
- return false;
- }
- currentTime.setHours($this.data('hour'));
- currentTime.setMinutes($this.data('minute'));
- datetimepicker.trigger('select.xdsoft', [currentTime]);
-
- datetimepicker.data('input').val(_xdsoft_datetime.str());
-
- if (options.inline !== true && options.closeOnTimeSelect === true) {
- datetimepicker.trigger('close.xdsoft');
- }
-
- if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
- options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
- }
- datetimepicker.data('changed', true);
- datetimepicker.trigger('xchange.xdsoft');
- datetimepicker.trigger('changedatetime.xdsoft');
- });
-
-
- datepicker
- .on('mousewheel.xdsoft', function (event) {
- if (!options.scrollMonth) {
- return true;
- }
- if (event.deltaY < 0) {
- _xdsoft_datetime.nextMonth();
- } else {
- _xdsoft_datetime.prevMonth();
- }
- return false;
- });
-
- input
- .on('mousewheel.xdsoft', function (event) {
- if (!options.scrollInput) {
- return true;
- }
- if (!options.datepicker && options.timepicker) {
- current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
- if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
- current_time_index += event.deltaY;
- }
- if (timebox.children().eq(current_time_index).length) {
- timebox.children().eq(current_time_index).trigger('mousedown');
- }
- return false;
- }
- if (options.datepicker && !options.timepicker) {
- datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
- if (input.val) {
- input.val(_xdsoft_datetime.str());
- }
- datetimepicker.trigger('changedatetime.xdsoft');
- return false;
- }
- });
-
- datetimepicker
- .on('changedatetime.xdsoft', function (event) {
- if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
- var $input = datetimepicker.data('input');
- options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
- delete options.value;
- $input.trigger('change');
- }
- })
- .on('generate.xdsoft', function () {
- if (options.onGenerate && $.isFunction(options.onGenerate)) {
- options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
- }
- if (triggerAfterOpen) {
- datetimepicker.trigger('afterOpen.xdsoft');
- triggerAfterOpen = false;
- }
- })
- .on('click.xdsoft', function (xdevent) {
- xdevent.stopPropagation();
- });
-
- current_time_index = 0;
-
- setPos = function () {
- var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute", node;
- if (datetimepicker.data('input').parent().css('direction') == 'rtl')
- left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
- if (options.fixed) {
- top -= $(window).scrollTop();
- left -= $(window).scrollLeft();
- position = "fixed";
- } else {
- if (top + datetimepicker[0].offsetHeight > $(window).height() + $(window).scrollTop()) {
- top = offset.top - datetimepicker[0].offsetHeight + 1;
- }
- if (top < 0) {
- top = 0;
- }
- if (left + datetimepicker[0].offsetWidth > $(window).width()) {
- left = $(window).width() - datetimepicker[0].offsetWidth;
- }
- }
-
- node = datetimepicker[0];
- do {
- node = node.parentNode;
- if (window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) {
- left = left - (($(window).width() - node.offsetWidth) / 2);
- break;
- }
- } while (node.nodeName !== 'HTML');
- datetimepicker.css({
- left: left,
- top: top,
- position: position
- });
- };
- datetimepicker
- .on('open.xdsoft', function (event) {
- var onShow = true;
- if (options.onShow && $.isFunction(options.onShow)) {
- onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
- }
- if (onShow !== false) {
- datetimepicker.show();
- setPos();
- $(window)
- .off('resize.xdsoft', setPos)
- .on('resize.xdsoft', setPos);
-
- if (options.closeOnWithoutClick) {
- $([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() {
- datetimepicker.trigger('close.xdsoft');
- $([document.body, window]).off('mousedown.xdsoft', arguments_callee6);
- });
- }
- }
- })
- .on('close.xdsoft', function (event) {
- var onClose = true;
- mounth_picker
- .find('.xdsoft_month,.xdsoft_year')
- .find('.xdsoft_select')
- .hide();
- if (options.onClose && $.isFunction(options.onClose)) {
- onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
- }
- if (onClose !== false && !options.opened && !options.inline) {
- datetimepicker.hide();
- }
- event.stopPropagation();
- })
- .on('toggle.xdsoft', function (event) {
- if (datetimepicker.is(':visible')) {
- datetimepicker.trigger('close.xdsoft');
- } else {
- datetimepicker.trigger('open.xdsoft');
- }
- })
- .data('input', input);
-
- timer = 0;
- timer1 = 0;
-
- datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
- datetimepicker.setOptions(options);
-
- function getCurrentValue() {
- var ct = false, time;
-
- if (options.startDate) {
- ct = _xdsoft_datetime.strToDate(options.startDate);
- } else {
- ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
- if (ct) {
- ct = _xdsoft_datetime.strToDateTime(ct);
- } else if (options.defaultDate) {
- ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
- if (options.defaultTime) {
- time = _xdsoft_datetime.strtotime(options.defaultTime);
- ct.setHours(time.getHours());
- ct.setMinutes(time.getMinutes());
- }
- }
- }
-
- if (ct && _xdsoft_datetime.isValidDate(ct)) {
- datetimepicker.data('changed', true);
- } else {
- ct = '';
- }
-
- return ct || 0;
- }
-
- _xdsoft_datetime.setCurrentTime(getCurrentValue());
-
- input
- .data('xdsoft_datetimepicker', datetimepicker)
- .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) {
- if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
- return;
- }
- clearTimeout(timer);
- timer = setTimeout(function () {
- if (input.is(':disabled')) {
- return;
- }
-
- triggerAfterOpen = true;
- _xdsoft_datetime.setCurrentTime(getCurrentValue());
-
- datetimepicker.trigger('open.xdsoft');
- }, 100);
- })
- .on('keydown.xdsoft', function (event) {
- var val = this.value, elementSelector,
- key = event.which;
- if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
- elementSelector = $("input:visible,textarea:visible");
- datetimepicker.trigger('close.xdsoft');
- elementSelector.eq(elementSelector.index(this) + 1).focus();
- return false;
- }
- if ([TAB].indexOf(key) !== -1) {
- datetimepicker.trigger('close.xdsoft');
- return true;
- }
- });
- };
- destroyDateTimePicker = function (input) {
- var datetimepicker = input.data('xdsoft_datetimepicker');
- if (datetimepicker) {
- datetimepicker.data('xdsoft_datetime', null);
- datetimepicker.remove();
- input
- .data('xdsoft_datetimepicker', null)
- .off('.xdsoft');
- $(window).off('resize.xdsoft');
- $([window, document.body]).off('mousedown.xdsoft');
- if (input.unmousewheel) {
- input.unmousewheel();
- }
- }
- };
- $(document)
- .off('keydown.xdsoftctrl keyup.xdsoftctrl')
- .on('keydown.xdsoftctrl', function (e) {
- if (e.keyCode === CTRLKEY) {
- ctrlDown = true;
- }
- })
- .on('keyup.xdsoftctrl', function (e) {
- if (e.keyCode === CTRLKEY) {
- ctrlDown = false;
- }
- });
- return this.each(function () {
- var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
- if (datetimepicker) {
- if ($.type(opt) === 'string') {
- switch (opt) {
- case 'show':
- $(this).select().focus();
- datetimepicker.trigger('open.xdsoft');
- break;
- case 'hide':
- datetimepicker.trigger('close.xdsoft');
- break;
- case 'toggle':
- datetimepicker.trigger('toggle.xdsoft');
- break;
- case 'destroy':
- destroyDateTimePicker($(this));
- break;
- case 'reset':
- this.value = this.defaultValue;
- if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format))) {
- datetimepicker.data('changed', false);
- }
- datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
- break;
- case 'validate':
- $input = datetimepicker.data('input');
- $input.trigger('blur.xdsoft');
- break;
- }
- } else {
- datetimepicker
- .setOptions(opt);
- }
- return 0;
- }
- if ($.type(opt) !== 'string') {
- if (!options.lazyInit || options.open || options.inline) {
- createDateTimePicker($(this));
- } else {
- lazyInit($(this));
- }
- }
- });
- };
- $.fn.datetimepicker.defaults = default_options;
-}(jQuery));
-
-function HighlightedDate(date, desc, style) {
- "use strict";
- this.date = date;
- this.desc = desc;
- this.style = style;
-}
-
-(function () {
-
-/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Version: 3.1.12
- *
- * Requires: jQuery 1.2.2+
- */
-!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
-
-// Parse and Format Library
-//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
-/*
- * Copyright (C) 2004 Baron Schwartz
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation, version 2.1.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var codePrefix="Date.prototype."+funcName+" = function() {return ";var code="";var special=false;var ch="";for(var i=0;i 0) {";var regex="";var special=false;var ch="";for(var i=0;i 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$",'i');eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;bs?"20":"19")+i):s,h=!0;break;case"m":case"n":case"M":case"F":if(isNaN(s)){if(!((d=m.getMonth(i))>0))return null;y.month=d}else{if(!(s>=1&&12>=s))return null;y.month=s}h=!0;break;case"d":case"j":if(!(s>=1&&31>=s))return null;y.day=s,h=!0;break;case"g":case"h":if(u=n.indexOf("a")>-1?n.indexOf("a"):n.indexOf("A")>-1?n.indexOf("A"):-1,c=r[u],u>-1)l=e(c,p.meridiem[0])?0:e(c,p.meridiem[1])?12:-1,s>=1&&12>=s&&l>-1?y.hour=s+l-1:s>=0&&23>=s&&(y.hour=s);else{if(!(s>=0&&23>=s))return null;y.hour=s}g=!0;break;case"G":case"H":if(!(s>=0&&23>=s))return null;y.hour=s,g=!0;break;case"i":if(!(s>=0&&59>=s))return null;y.min=s,g=!0;break;case"s":if(!(s>=0&&59>=s))return null;y.sec=s,g=!0}if(!0===h&&y.year&&y.month&&y.day)y.date=new Date(y.year,y.month-1,y.day,y.hour,y.min,y.sec,0);else{if(!0!==g)return null;y.date=new Date(0,0,0,y.hour,y.min,y.sec,0)}return y.date},guessDate:function(e,t){if("string"!=typeof e)return e;var a,n,r,o,i,s,d=this,u=e.replace(d.separators,"\0").split("\0"),l=/^[djmn]/g,f=t.match(d.validParts),c=new Date,m=0;if(!l.test(f[0]))return e;for(r=0;ra?a:4,!(n=parseInt(4>a?n.toString().substr(0,4-a)+i:i.substr(0,4))))return null;c.setFullYear(n);break;case 3:c.setHours(s);break;case 4:c.setMinutes(s);break;case 5:c.setSeconds(s)}(o=i.substr(m)).length>0&&u.splice(r+1,0,o)}return c},parseFormat:function(e,a){var n,r=this,s=r.dateSettings,d=/\\?(.?)/gi,u=function(e,t){return n[e]?n[e]():t};return n={d:function(){return t(n.j(),2)},D:function(){return s.daysShort[n.w()]},j:function(){return a.getDate()},l:function(){return s.days[n.w()]},N:function(){return n.w()||7},w:function(){return a.getDay()},z:function(){var e=new Date(n.Y(),n.n()-1,n.j()),t=new Date(n.Y(),0,1);return Math.round((e-t)/o)},W:function(){var e=new Date(n.Y(),n.n()-1,n.j()-n.N()+3),a=new Date(e.getFullYear(),0,4);return t(1+Math.round((e-a)/o/7),2)},F:function(){return s.months[a.getMonth()]},m:function(){return t(n.n(),2)},M:function(){return s.monthsShort[a.getMonth()]},n:function(){return a.getMonth()+1},t:function(){return new Date(n.Y(),n.n(),0).getDate()},L:function(){var e=n.Y();return e%4==0&&e%100!=0||e%400==0?1:0},o:function(){var e=n.n(),t=n.W();return n.Y()+(12===e&&9>t?1:1===e&&t>9?-1:0)},Y:function(){return a.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return n.A().toLowerCase()},A:function(){var e=n.G()<12?0:1;return s.meridiem[e]},B:function(){var e=a.getUTCHours()*i,n=60*a.getUTCMinutes(),r=a.getUTCSeconds();return t(Math.floor((e+n+r+i)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return a.getHours()},h:function(){return t(n.g(),2)},H:function(){return t(n.G(),2)},i:function(){return t(a.getMinutes(),2)},s:function(){return t(a.getSeconds(),2)},u:function(){return t(1e3*a.getMilliseconds(),6)},e:function(){return/\((.*)\)/.exec(String(a))[1]||"Coordinated Universal Time"},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=a.getTimezoneOffset(),n=Math.abs(e);return(e>0?"-":"+")+t(100*Math.floor(n/60)+n%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return(String(a).match(r.tzParts)||[""]).pop().replace(r.tzClip,"")||"UTC"},Z:function(){return 60*-a.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(d,u)},r:function(){return"D, d M Y H:i:s O".replace(d,u)},U:function(){return a.getTime()/1e3||0}},u(e,e)},formatDate:function(e,t){var a,n,r,o,i,s=this,d="";if("string"==typeof e&&!(e=s.parseDate(e,t)))return null;if(e instanceof Date){for(r=t.length,a=0;r>a;a++)"S"!==(i=t.charAt(a))&&"\\"!==i&&(a>0&&"\\"===t.charAt(a-1)?d+=i:(o=s.parseFormat(i,e),a!==r-1&&s.intParts.test(i)&&"S"===t.charAt(a+1)&&(n=parseInt(o)||0,o+=s.dateSettings.ordinal(n)),d+=o));return d}return""}}}();var datetimepickerFactory=function(e){"use strict";function t(e,t,a){this.date=e,this.desc=t,this.style=a}var a={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["ن","ث","ع","خ","ج","س","ح"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeekShort:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeekShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayOfWeek:["یکشنبه","دوشنبه","سهشنبه","چهارشنبه","پنجشنبه","جمعه","شنبه","یکشنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeekShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeekShort:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"],dayOfWeek:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeekShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeekShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeekShort:["nd","pn","wt","śr","cz","pt","sb"],dayOfWeek:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា","កុម្ភៈ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],dayOfWeekShort:["អាទិ","ច័ន្ទ","អង្គារ","ពុធ","ព្រហ","សុក្រ","សៅរ៍"],dayOfWeek:["អាទិត្យ","ច័ន្ទ","អង្គារ","ពុធ","ព្រហស្បតិ៍","សុក្រ","សៅរ៍"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["日","月","火","水","木","金","土"],dayOfWeek:["日曜","月曜","火曜","水曜","木曜","金曜","土曜"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayOfWeek:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","сре","чет","пет","саб"],dayOfWeek:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeekShort:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"],dayOfWeek:["Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба","Ням"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Št","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","čet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","сре","чет","пет","суб"],dayOfWeek:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ug:{months:["1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"],dayOfWeek:["يەكشەنبە","دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"]},he:{months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],dayOfWeekShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],dayOfWeek:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeekShort:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"],dayOfWeek:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","Аяк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],dayOfWeekShort:["კვ","ორშ","სამშ","ოთხ","ხუთ","პარ","შაბ"],dayOfWeek:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"]}},ownerDocument:document,contentWindow:window,value:"",rtl:!1,format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,minDateTime:!1,disabledMinTime:!1,disabledMaxTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],highlightedDates:[],highlightedPeriods:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1},n=null,r="en",o={meridiem:["AM","PM"]},i=function(){var t=a.i18n[r],i={days:t.dayOfWeek,daysShort:t.dayOfWeekShort,months:t.months,monthsShort:e.map(t.months,function(e){return e.substring(0,3)})};"function"==typeof DateFormatter&&(n=new DateFormatter({dateSettings:e.extend({},o,i)}))};e.datetimepicker={setLocale:function(e){var t=a.i18n[e]?e:"en";r!==t&&(r=t,i())},setDateFormatter:function(e){n=e},RFC_2822:"D, d M Y H:i:s O",ATOM:"Y-m-dTH:i:sP",ISO_8601:"Y-m-dTH:i:sO",RFC_822:"D, d M y H:i:s O",RFC_850:"l, d-M-y H:i:s T",RFC_1036:"D, d M y H:i:s O",RFC_1123:"D, d M Y H:i:s O",RSS:"D, d M Y H:i:s O",W3C:"Y-m-dTH:i:sP"},i(),window.getComputedStyle||(window.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var a=/(-([a-z]))/g;return"float"===t&&(t="styleFloat"),a.test(t)&&(t=t.replace(a,function(e,t,a){return a.toUpperCase()})),e.currentStyle[t]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,n;for(a=t||0,n=this.length;a'),s=e(''),i.append(s),d.addClass("xdsoft_scroller_box").append(i),y=function(e){var t=u(e).y-c+p;t<0&&(t=0),t+s[0].offsetHeight>h&&(t=h-s[0].offsetHeight),d.trigger("scroll_element.xdsoft_scroller",[l?t/l:0])},s.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(n){r||d.trigger("resize_scroll.xdsoft_scroller",[a]),c=u(n).y,p=parseInt(s.css("margin-top"),10),h=i[0].offsetHeight,"mousedown"===n.type||"touchstart"===n.type?(t.ownerDocument&&e(t.ownerDocument.body).addClass("xdsoft_noselect"),e([t.ownerDocument.body,t.contentWindow]).on("touchend mouseup.xdsoft_scroller",function a(){e([t.ownerDocument.body,t.contentWindow]).off("touchend mouseup.xdsoft_scroller",a).off("mousemove.xdsoft_scroller",y).removeClass("xdsoft_noselect")}),e(t.ownerDocument.body).on("mousemove.xdsoft_scroller",y)):(g=!0,n.stopPropagation(),n.preventDefault())}).on("touchmove",function(e){g&&(e.preventDefault(),y(e))}).on("touchend touchcancel",function(){g=!1,p=0}),d.on("scroll_element.xdsoft_scroller",function(e,t){r||d.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=t>1?1:t<0||isNaN(t)?0:t,s.css("margin-top",l*t),setTimeout(function(){n.css("marginTop",-parseInt((n[0].offsetHeight-r)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,a){var u,f;r=d[0].clientHeight,o=n[0].offsetHeight,f=(u=r/o)*i[0].offsetHeight,u>1?s.hide():(s.show(),s.css("height",parseInt(f>10?f:10,10)),l=i[0].offsetHeight-s[0].offsetHeight,!0!==a&&d.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(n.css("marginTop"),10))/(o-r)]))}),d.on("mousewheel",function(e){var t=Math.abs(parseInt(n.css("marginTop"),10));return(t-=20*e.deltaY)<0&&(t=0),d.trigger("scroll_element.xdsoft_scroller",[t/(o-r)]),e.stopPropagation(),!1}),d.on("touchstart",function(e){f=u(e),m=Math.abs(parseInt(n.css("marginTop"),10))}),d.on("touchmove",function(e){if(f){e.preventDefault();var t=u(e);d.trigger("scroll_element.xdsoft_scroller",[(m-(t.y-f.y))/(o-r)])}}),d.on("touchend touchcancel",function(){f=!1,m=0})),d.trigger("resize_scroll.xdsoft_scroller",[a])):d.find(".xdsoft_scrollbar").hide()})},e.fn.datetimepicker=function(o,i){var s,d,u=this,l=48,f=57,c=96,m=105,h=17,g=46,p=13,y=27,D=8,v=37,b=38,k=39,x=40,T=9,S=116,w=65,O=67,M=86,W=90,_=89,F=!1,C=e.isPlainObject(o)||!o?e.extend(!0,{},a,o):e.extend(!0,{},a),P=0,A=function(e){e.on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function t(){e.is(":disabled")||e.data("xdsoft_datetimepicker")||(clearTimeout(P),P=setTimeout(function(){e.data("xdsoft_datetimepicker")||s(e),e.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",t).trigger("open.xdsoft")},100))})};return s=function(a){function i(){var e,t=!1;return C.startDate?t=Y.strToDate(C.startDate):(t=C.value||(a&&a.val&&a.val()?a.val():""))?t=Y.strToDateTime(t):C.defaultDate&&(t=Y.strToDateTime(C.defaultDate),C.defaultTime&&(e=Y.strtotime(C.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&Y.isValidDate(t)?H.data("changed",!0):t="",t||0}function s(t){var n=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)},r=function(e){try{if(t.ownerDocument.selection&&t.ownerDocument.selection.createRange)return t.ownerDocument.selection.createRange().getBookmark().charCodeAt(2)-2;if(e.setSelectionRange)return e.selectionStart}catch(e){return 0}},o=function(e,a){if(!(e="string"==typeof e||e instanceof String?t.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var n=e.createTextRange();return n.collapse(!0),n.moveEnd("character",a),n.moveStart("character",a),n.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(a,a),!0)};t.mask&&a.off("keydown.xdsoft"),!0===t.mask&&("undefined"!=typeof moment?t.mask=t.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"):t.mask=t.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===e.type(t.mask)&&(n(t.mask,a.val())||(a.val(t.mask.replace(/[0-9]/g,"_")),o(a[0],0)),a.on("keydown.xdsoft",function(i){var s,d,u=this.value,C=i.which;if(C>=l&&C<=f||C>=c&&C<=m||C===D||C===g){for(s=r(this),d=C!==D&&C!==g?String.fromCharCode(c<=C&&C<=m?C-l:C):"_",C!==D&&C!==g||!s||(s-=1,d="_");/[^0-9_]/.test(t.mask.substr(s,1))&&s0;)s+=C===D||C===g?-1:1;if(u=u.substr(0,s)+d+u.substr(s+1),""===e.trim(u))u=t.mask.replace(/[0-9]/g,"_");else if(s===t.mask.length)return i.preventDefault(),!1;for(s+=C===D||C===g?0:1;/[^0-9_]/.test(t.mask.substr(s,1))&&s0;)s+=C===D||C===g?-1:1;n(t.mask,u)?(this.value=u,o(this,s)):""===e.trim(u)?this.value=t.mask.replace(/[0-9]/g,"_"):a.trigger("error_input.xdsoft")}else if(-1!==[w,O,M,W,_].indexOf(C)&&F||-1!==[y,b,x,v,k,S,h,T,p].indexOf(C))return!0;return i.preventDefault(),!1}))}var d,u,P,A,Y,j,H=e(''),J=e(''),z=e(''),I=e(''),N=e(''),L=e(''),E=L.find(".xdsoft_time_box").eq(0),R=e(''),B=e(''),V=e(''),G=e(''),U=!1,q=0;C.id&&H.attr("id",C.id),C.style&&H.attr("style",C.style),C.weeks&&H.addClass("xdsoft_showweeks"),C.rtl&&H.addClass("xdsoft_rtl"),H.addClass("xdsoft_"+C.theme),H.addClass(C.className),I.find(".xdsoft_month span").after(V),I.find(".xdsoft_year span").after(G),I.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(t){var a,n,r=e(this).find(".xdsoft_select").eq(0),o=0,i=0,s=r.is(":visible");for(I.find(".xdsoft_select").hide(),Y.currentTime&&(o=Y.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),r[s?"hide":"show"](),a=r.find("div.xdsoft_option"),n=0;n=0&&a<24&&r>=0&&r<60?e(this).val([a,r].map(function(e){return e>9?e:"0"+e}).join(":")):e(this).val(n.formatDate(Y.now(),C.format))}H.data("xdsoft_datetime").setCurrentTime(e(this).val())}H.trigger("changedatetime.xdsoft"),H.trigger("close.xdsoft")}),C.dayOfWeekStartPrev=0===C.dayOfWeekStart?6:C.dayOfWeekStart-1,H.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},H.data("options",C).on("touchstart mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),G.hide(),V.hide(),!1}),E.append(R),E.xdsoftScroller(C),H.on("afterOpen.xdsoft",function(){E.xdsoftScroller(C)}),H.append(z).append(L),!0!==C.withoutCopyright&&H.append(J),z.append(I).append(N).append(B),e(C.parentID).append(H),Y=new function(){var t=this;t.now=function(e){var a,n,r=new Date;return!e&&C.defaultDate&&(a=t.strToDateTime(C.defaultDate),r.setFullYear(a.getFullYear()),r.setMonth(a.getMonth()),r.setDate(a.getDate())),C.yearOffset&&r.setFullYear(r.getFullYear()+C.yearOffset),!e&&C.defaultTime&&(n=t.strtotime(C.defaultTime),r.setHours(n.getHours()),r.setMinutes(n.getMinutes())),r},t.isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},t.setCurrentTime=function(e,a){"string"==typeof e?t.currentTime=t.strToDateTime(e):t.isValidDate(e)?t.currentTime=e:e||a||!C.allowBlank||C.inline?t.currentTime=t.now():t.currentTime=null,H.trigger("xchange.xdsoft")},t.empty=function(){t.currentTime=null},t.getCurrentTime=function(){return t.currentTime},t.nextMonth=function(){void 0!==t.currentTime&&null!==t.currentTime||(t.currentTime=t.now());var a,n=t.currentTime.getMonth()+1;return 12===n&&(t.currentTime.setFullYear(t.currentTime.getFullYear()+1),n=0),a=t.currentTime.getFullYear(),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),n+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),C.onChangeMonth&&e.isFunction(C.onChangeMonth)&&C.onChangeMonth.call(H,Y.currentTime,H.data("input")),a!==t.currentTime.getFullYear()&&e.isFunction(C.onChangeYear)&&C.onChangeYear.call(H,Y.currentTime,H.data("input")),H.trigger("xchange.xdsoft"),n},t.prevMonth=function(){void 0!==t.currentTime&&null!==t.currentTime||(t.currentTime=t.now());var a=t.currentTime.getMonth()-1;return-1===a&&(t.currentTime.setFullYear(t.currentTime.getFullYear()-1),a=11),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),a+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(a),C.onChangeMonth&&e.isFunction(C.onChangeMonth)&&C.onChangeMonth.call(H,Y.currentTime,H.data("input")),H.trigger("xchange.xdsoft"),a},t.getWeekOfYear=function(t){if(C.onGetWeekOfYear&&e.isFunction(C.onGetWeekOfYear)){var a=C.onGetWeekOfYear.call(H,t);if(void 0!==a)return a}var n=new Date(t.getFullYear(),0,1);return 4!==n.getDay()&&n.setMonth(0,1+(4-n.getDay()+7)%7),Math.ceil(((t-n)/864e5+n.getDay()+1)/7)},t.strToDateTime=function(e){var a,r,o=[];return e&&e instanceof Date&&t.isValidDate(e)?e:((o=/^([+-]{1})(.*)$/.exec(e))&&(o[2]=n.parseDate(o[2],C.formatDate)),o&&o[2]?(a=o[2].getTime()-6e4*o[2].getTimezoneOffset(),r=new Date(t.now(!0).getTime()+parseInt(o[1]+"1",10)*a)):r=e?n.parseDate(e,C.format):t.now(),t.isValidDate(r)||(r=t.now()),r)},t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var a=e?n.parseDate(e,C.formatDate):t.now(!0);return t.isValidDate(a)||(a=t.now(!0)),a},t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var a=e?n.parseDate(e,C.formatTime):t.now(!0);return t.isValidDate(a)||(a=t.now(!0)),a},t.str=function(){return n.formatDate(t.currentTime,C.format)},t.currentTime=this.now()},B.on("touchend click",function(e){e.preventDefault(),H.data("changed",!0),Y.setCurrentTime(i()),a.val(Y.str()),H.trigger("close.xdsoft")}),I.find(".xdsoft_today_button").on("touchend mousedown.xdsoft",function(){H.data("changed",!0),Y.setCurrentTime(0,!0),H.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e,t,n=Y.getCurrentTime();n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),e=Y.strToDate(C.minDate),n<(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()))||(t=Y.strToDate(C.maxDate),n>(t=new Date(t.getFullYear(),t.getMonth(),t.getDate()))||(a.val(Y.str()),a.trigger("change"),H.trigger("close.xdsoft")))}),I.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),a=0,n=!1;!function e(r){t.hasClass(C.next)?Y.nextMonth():t.hasClass(C.prev)&&Y.prevMonth(),C.monthChangeSpinner&&(n||(a=setTimeout(e,r||100)))}(500),e([C.ownerDocument.body,C.contentWindow]).on("touchend mouseup.xdsoft",function t(){clearTimeout(a),n=!0,e([C.ownerDocument.body,C.contentWindow]).off("touchend mouseup.xdsoft",t)})}),L.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),a=0,n=!1,r=110;!function e(o){var i=E[0].clientHeight,s=R[0].offsetHeight,d=Math.abs(parseInt(R.css("marginTop"),10));t.hasClass(C.next)&&s-i-C.timeHeightInTimePicker>=d?R.css("marginTop","-"+(d+C.timeHeightInTimePicker)+"px"):t.hasClass(C.prev)&&d-C.timeHeightInTimePicker>=0&&R.css("marginTop","-"+(d-C.timeHeightInTimePicker)+"px"),E.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(R[0].style.marginTop,10)/(s-i))]),r=r>10?10:r-10,n||(a=setTimeout(e,o||r))}(500),e([C.ownerDocument.body,C.contentWindow]).on("touchend mouseup.xdsoft",function t(){clearTimeout(a),n=!0,e([C.ownerDocument.body,C.contentWindow]).off("touchend mouseup.xdsoft",t)})}),d=0,H.on("xchange.xdsoft",function(t){clearTimeout(d),d=setTimeout(function(){void 0!==Y.currentTime&&null!==Y.currentTime||(Y.currentTime=Y.now());for(var t,i,s,d,u,l,f,c,m,h,g="",p=new Date(Y.currentTime.getFullYear(),Y.currentTime.getMonth(),1,12,0,0),y=0,D=Y.now(),v=!1,b=!1,k=!1,x=[],T=!0,S="";p.getDay()!==C.dayOfWeekStart;)p.setDate(p.getDate()-1);for(g+="",C.weeks&&(g+=" | "),t=0;t<7;t+=1)g+=""+C.i18n[r].dayOfWeekShort[(t+C.dayOfWeekStart)%7]+" | ";for(g+="
",g+="",!1!==C.maxDate&&(v=Y.strToDate(C.maxDate),v=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59,999)),!1!==C.minDate&&(b=Y.strToDate(C.minDate),b=new Date(b.getFullYear(),b.getMonth(),b.getDate())),!1!==C.minDateTime&&(k=Y.strToDate(C.minDateTime),k=new Date(k.getFullYear(),k.getMonth(),k.getDate(),k.getHours(),k.getMinutes(),k.getSeconds()));y0&&-1===C.allowDates.indexOf(n.formatDate(p,C.formatDate))&&x.push("xdsoft_disabled"),(!1!==v&&p>v||!1!==k&&p",T=!1,C.weeks&&(g+=""+f+" | ")),g+=''+d+" | ",p.getDay()===C.dayOfWeekStartPrev&&(g+="",T=!0),p.setDate(d+1);if(g+="
",N.html(g),I.find(".xdsoft_label span").eq(0).text(C.i18n[r].months[Y.currentTime.getMonth()]),I.find(".xdsoft_label span").eq(1).text(Y.currentTime.getFullYear()),S="","",l="",m=function(t,r){var o,i,s=Y.now(),d=C.allowTimes&&e.isArray(C.allowTimes)&&C.allowTimes.length;s.setHours(t),t=parseInt(s.getHours(),10),s.setMinutes(r),r=parseInt(s.getMinutes(),10),(o=new Date(Y.currentTime)).setHours(t),o.setMinutes(r),x=[],!1!==C.minDateTime&&C.minDateTime>o||!1!==C.maxTime&&Y.strtotime(C.maxTime).getTime()s.getTime()?x.push("xdsoft_disabled"):!1!==C.minDateTime&&C.minDateTime>o||!1!==C.disabledMinTime&&s.getTime()>Y.strtotime(C.disabledMinTime).getTime()&&!1!==C.disabledMaxTime&&s.getTime()59||i.getMinutes()===parseInt(r,10))&&(C.defaultSelect||H.data("changed")?x.push("xdsoft_current"):C.initTime&&x.push("xdsoft_init_time")),parseInt(D.getHours(),10)===parseInt(t,10)&&parseInt(D.getMinutes(),10)===parseInt(r,10)&&x.push("xdsoft_today"),S+=''+n.formatDate(s,C.formatTime)+"
"},C.allowTimes&&e.isArray(C.allowTimes)&&C.allowTimes.length)for(y=0;y'+y+"";for(G.children().eq(0).html(o),y=parseInt(C.monthStart,10),o="";y<=parseInt(C.monthEnd,10);y+=1)o+=''+C.i18n[r].months[y]+"
";V.children().eq(0).html(o),e(H).trigger("generate.xdsoft")},10),t.stopPropagation()}).on("afterOpen.xdsoft",function(){if(C.timepicker){var e,t,a,n;R.find(".xdsoft_current").length?e=".xdsoft_current":R.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=E[0].clientHeight,(a=R[0].offsetHeight)-t<(n=R.find(e).index()*C.timeHeightInTimePicker+1)&&(n=a-t),E.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(a-t)])):E.trigger("scroll_element.xdsoft_scroller",[0])}}),u=0,N.on("touchend click.xdsoft","td",function(t){t.stopPropagation(),u+=1;var n=e(this),r=Y.currentTime;if(void 0!==r&&null!==r||(Y.currentTime=Y.now(),r=Y.currentTime),n.hasClass("xdsoft_disabled"))return!1;r.setDate(1),r.setFullYear(n.data("year")),r.setMonth(n.data("month")),r.setDate(n.data("date")),H.trigger("select.xdsoft",[r]),a.val(Y.str()),C.onSelectDate&&e.isFunction(C.onSelectDate)&&C.onSelectDate.call(H,Y.currentTime,H.data("input"),t),H.data("changed",!0),H.trigger("xchange.xdsoft"),H.trigger("changedatetime.xdsoft"),(u>1||!0===C.closeOnDateSelect||!1===C.closeOnDateSelect&&!C.timepicker)&&!C.inline&&H.trigger("close.xdsoft"),setTimeout(function(){u=0},200)}),R.on("touchstart","div",function(e){this.touchmoved=!1}).on("touchmove","div",function(e){this.touchmoved=!0}).on("touchend click.xdsoft","div",function(t){if(!this.touchmoved){t.stopPropagation();var a=e(this),n=Y.currentTime;if(void 0!==n&&null!==n||(Y.currentTime=Y.now(),n=Y.currentTime),a.hasClass("xdsoft_disabled"))return!1;n.setHours(a.data("hour")),n.setMinutes(a.data("minute")),H.trigger("select.xdsoft",[n]),H.data("input").val(Y.str()),C.onSelectTime&&e.isFunction(C.onSelectTime)&&C.onSelectTime.call(H,Y.currentTime,H.data("input"),t),H.data("changed",!0),H.trigger("xchange.xdsoft"),H.trigger("changedatetime.xdsoft"),!0!==C.inline&&!0===C.closeOnTimeSelect&&H.trigger("close.xdsoft")}}),z.on("mousewheel.xdsoft",function(e){return!C.scrollMonth||(e.deltaY<0?Y.nextMonth():Y.prevMonth(),!1)}),a.on("mousewheel.xdsoft",function(e){return!C.scrollInput||(!C.datepicker&&C.timepicker?((P=R.find(".xdsoft_current").length?R.find(".xdsoft_current").eq(0).index():0)+e.deltaY>=0&&P+e.deltaYc+m?(l="bottom",n=c+m-t.top):n-=m):n+H[0].offsetHeight>c+m&&(n=t.top-H[0].offsetHeight+1),n<0&&(n=0),r+a.offsetWidth>u&&(r=u-a.offsetWidth)),i=H[0],j(i,function(e){if("relative"===C.contentWindow.getComputedStyle(e).getPropertyValue("position")&&u>=e.offsetWidth)return r-=(u-e.offsetWidth)/2,!1}),(f={position:o,left:r,top:"",bottom:""})[l]=n,H.css(f)},H.on("open.xdsoft",function(t){var a=!0;C.onShow&&e.isFunction(C.onShow)&&(a=C.onShow.call(H,Y.currentTime,H.data("input"),t)),!1!==a&&(H.show(),A(),e(C.contentWindow).off("resize.xdsoft",A).on("resize.xdsoft",A),C.closeOnWithoutClick&&e([C.ownerDocument.body,C.contentWindow]).on("touchstart mousedown.xdsoft",function t(){H.trigger("close.xdsoft"),e([C.ownerDocument.body,C.contentWindow]).off("touchstart mousedown.xdsoft",t)}))}).on("close.xdsoft",function(t){var a=!0;I.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),C.onClose&&e.isFunction(C.onClose)&&(a=C.onClose.call(H,Y.currentTime,H.data("input"),t)),!1===a||C.opened||C.inline||H.hide(),t.stopPropagation()}).on("toggle.xdsoft",function(){H.is(":visible")?H.trigger("close.xdsoft"):H.trigger("open.xdsoft")}).data("input",a),q=0,H.data("xdsoft_datetime",Y),H.setOptions(C),Y.setCurrentTime(i()),a.data("xdsoft_datetimepicker",H).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){a.is(":disabled")||a.data("xdsoft_datetimepicker").is(":visible")&&C.closeOnInputClick||(clearTimeout(q),q=setTimeout(function(){a.is(":disabled")||(U=!0,Y.setCurrentTime(i(),!0),C.mask&&s(C),H.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(t){var a,n=t.which;return-1!==[p].indexOf(n)&&C.enterLikeTab?(a=e("input:visible,textarea:visible,button:visible,a:visible"),H.trigger("close.xdsoft"),a.eq(a.index(this)+1).focus(),!1):-1!==[T].indexOf(n)?(H.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){H.trigger("close.xdsoft")})},d=function(t){var a=t.data("xdsoft_datetimepicker");a&&(a.data("xdsoft_datetime",null),a.remove(),t.data("xdsoft_datetimepicker",null).off(".xdsoft"),e(C.contentWindow).off("resize.xdsoft"),e([C.contentWindow,C.ownerDocument.body]).off("mousedown.xdsoft touchstart"),t.unmousewheel&&t.unmousewheel())},e(C.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===h&&(F=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===h&&(F=!1)}),this.each(function(){var t=e(this).data("xdsoft_datetimepicker");if(t){if("string"===e.type(o))switch(o){case"show":e(this).select().focus(),t.trigger("open.xdsoft");break;case"hide":t.trigger("close.xdsoft");break;case"toggle":t.trigger("toggle.xdsoft");break;case"destroy":d(e(this));break;case"reset":this.value=this.defaultValue,this.value&&t.data("xdsoft_datetime").isValidDate(n.parseDate(this.value,C.format))||t.data("changed",!1),t.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":t.data("input").trigger("blur.xdsoft");break;default:t[o]&&e.isFunction(t[o])&&(u=t[o](i))}else t.setOptions(o);return 0}"string"!==e.type(o)&&(!C.lazyInit||C.open||C.inline?s(e(this)):A(e(this)))}),u},e.fn.datetimepicker.defaults=a};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var i=t||window.event,s=d.call(arguments,1),u=0,f=0,c=0,m=0,h=0,g=0;if(t=e.event.fix(i),t.type="mousewheel","detail"in i&&(c=-1*i.detail),"wheelDelta"in i&&(c=i.wheelDelta),"wheelDeltaY"in i&&(c=i.wheelDeltaY),"wheelDeltaX"in i&&(f=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(f=-1*c,c=0),u=0===c?f:c,"deltaY"in i&&(u=c=-1*i.deltaY),"deltaX"in i&&(f=i.deltaX,0===c&&(u=-1*f)),0!==c||0!==f){if(1===i.deltaMode){var p=e.data(this,"mousewheel-line-height");u*=p,c*=p,f*=p}else if(2===i.deltaMode){var y=e.data(this,"mousewheel-page-height");u*=y,c*=y,f*=y}if(m=Math.max(Math.abs(c),Math.abs(f)),(!o||m=1?"floor":"ceil"](u/o),f=Math[f>=1?"floor":"ceil"](f/o),c=Math[c>=1?"floor":"ceil"](c/o),l.settings.normalizeOffset&&this.getBoundingClientRect){var D=this.getBoundingClientRect();h=t.clientX-D.left,g=t.clientY-D.top}return t.deltaX=f,t.deltaY=c,t.deltaFactor=o,t.offsetX=h,t.offsetY=g,t.deltaMode=0,s.unshift(t,u,f,c),r&&clearTimeout(r),r=setTimeout(a,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function a(){o=null}function n(e,t){return l.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var r,o,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],d=Array.prototype.slice;if(e.event.fixHooks)for(var u=i.length;u;)e.event.fixHooks[i[--u]]=e.event.mouseHooks;var l=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var a=s.length;a;)this.addEventListener(s[--a],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",l.getLineHeight(this)),e.data(this,"mousewheel-page-height",l.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var a=s.length;a;)this.removeEventListener(s[--a],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var a=e(t),n=a["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(a.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
\ No newline at end of file
diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php
index dc9f4c0d..f7fc78aa 100644
--- a/bl-kernel/boot/init.php
+++ b/bl-kernel/boot/init.php
@@ -59,108 +59,13 @@ define('DB_SYSLOG', PATH_DATABASES.'syslog.php');
define('DB_USERS', PATH_DATABASES.'users.php');
define('DB_SECURITY', PATH_DATABASES.'security.php');
-// Log separator
-define('LOG_SEP', ' | ');
-
// JSON pretty print
if(!defined('JSON_PRETTY_PRINT')) {
define('JSON_PRETTY_PRINT', 128);
}
-// Protecting against Symlink attacks
-define('CHECK_SYMBOLIC_LINKS', TRUE);
-
-// Alert status ok
-define('ALERT_STATUS_OK', 0);
-
-// Alert status fail
-define('ALERT_STATUS_FAIL', 1);
-
-// Amount of thumbnails shown on Bludit Quick images
-define('THUMBNAILS_AMOUNT', 6);
-
-// Thubmnails size
-define('THUMBNAILS_WIDTH', 400);
-define('THUMBNAILS_HEIGHT', 400);
-define('THUMBNAILS_QUALITY', 100); // 100%
-
-// Profile image size
-define('PROFILE_IMG_WIDTH', 400);
-define('PROFILE_IMG_HEIGHT', 400);
-define('PROFILE_IMG_QUALITY', 100); // 100%
-
-// Password length
-define('PASSWORD_LENGTH', 6);
-
-// Password salt length
-define('SALT_LENGTH', 8);
-
-// Page brake string
-define('PAGE_BREAK', '');
-
-// Parent key for the array $pagesByParents
-define('PARENT', 'BLUDIT3849abb4cb7abd24c2d8dac17b216f17');
-
-// Items per page for admin area
-define('ITEMS_PER_PAGE_ADMIN', 10);
-
-// Cli mode, status for new pages
-define('CLI_STATUS', 'published');
-
-// Cli mode, username for new pages
-define('CLI_USERNAME', 'admin');
-
-// Remember me
-define('REMEMBER_COOKIE_USERNAME', 'BLUDITREMEMBERUSERNAME');
-define('REMEMBER_COOKIE_TOKEN', 'BLUDITREMEMBERTOKEN');
-define('REMEMBER_COOKIE_EXPIRE_IN_DAYS', 30);
-
-// Filename
-define('FILENAME', 'index.txt');
-
-// Database date format
-define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
-
-// Database date format
-define('BACKUP_DATE_FORMAT', 'Y-m-d-H-i-s');
-
-// Sitemap date format
-define('SITEMAP_DATE_FORMAT', 'Y-m-d');
-
-// Date format for Dashboard schedule posts
-define('SCHEDULED_DATE_FORMAT', 'd M - h:i a');
-
-// Notifications date format
-define('NOTIFICATIONS_DATE_FORMAT', 'F j, Y, g:i a');
-
-// Amount of items to show on notification panel
-define('NOTIFICATIONS_AMOUNT', 10);
-
-// Token time to live for login via email. The offset is defined by http://php.net/manual/en/datetime.modify.php
-define('TOKEN_EMAIL_TTL', '+15 minutes');
-
-// Charset, default UTF-8.
-define('CHARSET', 'UTF-8');
-
-// EXTREME FRIENDLY URL, TRUE for dissmiss internet standard. Experimental!
-define('EXTREME_FRIENDLY_URL', FALSE);
-
-// Permissions for new directories
-define('DIR_PERMISSIONS', 0755);
-
-// Admin URI filter to access to the admin panel
-define('ADMIN_URI_FILTER', 'admin');
-
-// Default language file, in this case is English
-define('DEFAULT_LANGUAGE_FILE', 'en.json');
-
-// Session timeout server side, gc_maxlifetime
-// 3600 = 1hour
-define('SESSION_GC_MAXLIFETIME', 3600);
-
-// Session lifetime of the cookie in seconds which is sent to the browser
-// The value 0 means until the browser is closed
-define('SESSION_COOKIE_LIFE_TIME', 0);
+// User environment variables
+include(PATH_KERNEL.'boot'.DS.'variables.php');
// Set internal character encoding
mb_internal_encoding(CHARSET);
diff --git a/bl-kernel/boot/variables.php b/bl-kernel/boot/variables.php
new file mode 100644
index 00000000..3876ca03
--- /dev/null
+++ b/bl-kernel/boot/variables.php
@@ -0,0 +1,104 @@
+');
+
+// Parent key for the array $pagesByParents
+define('PARENT', 'BLUDIT3849abb4cb7abd24c2d8dac17b216f17');
+
+// Items per page for admin area
+define('ITEMS_PER_PAGE_ADMIN', 10);
+
+// Cli mode, status for new pages
+define('CLI_STATUS', 'published');
+
+// Cli mode, username for new pages
+define('CLI_USERNAME', 'admin');
+
+// Remember me
+define('REMEMBER_COOKIE_USERNAME', 'BLUDITREMEMBERUSERNAME');
+define('REMEMBER_COOKIE_TOKEN', 'BLUDITREMEMBERTOKEN');
+define('REMEMBER_COOKIE_EXPIRE_IN_DAYS', 30);
+
+// Filename
+define('FILENAME', 'index.txt');
+
+// Database date format
+define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
+
+// Database date format
+define('BACKUP_DATE_FORMAT', 'Y-m-d-H-i-s');
+
+// Sitemap date format
+define('SITEMAP_DATE_FORMAT', 'Y-m-d');
+
+// Date format for Dashboard schedule posts
+define('SCHEDULED_DATE_FORMAT', 'D, j M Y, H:i');
+
+// Notifications date format
+define('NOTIFICATIONS_DATE_FORMAT', 'D, j M Y, H:i');
+
+// Amount of items to show on notification panel
+define('NOTIFICATIONS_AMOUNT', 10);
+
+// Token time to live for login via email. The offset is defined by http://php.net/manual/en/datetime.modify.php
+define('TOKEN_EMAIL_TTL', '+15 minutes');
+
+// Charset, default UTF-8.
+define('CHARSET', 'UTF-8');
+
+// EXTREME FRIENDLY URL, TRUE for dissmiss internet standard. Experimental!
+define('EXTREME_FRIENDLY_URL', FALSE);
+
+// Permissions for new directories
+define('DIR_PERMISSIONS', 0755);
+
+// Admin URI filter to access to the admin panel
+define('ADMIN_URI_FILTER', 'admin');
+
+// Default language file, in this case is English
+define('DEFAULT_LANGUAGE_FILE', 'en.json');
+
+// Session timeout server side, gc_maxlifetime
+// 3600 = 1hour
+define('SESSION_GC_MAXLIFETIME', 3600);
+
+// Session lifetime of the cookie in seconds which is sent to the browser
+// The value 0 means until the browser is closed
+define('SESSION_COOKIE_LIFE_TIME', 0);
\ No newline at end of file
diff --git a/bl-kernel/dblanguage.class.php b/bl-kernel/dblanguage.class.php
index 4464fe76..e1bbcca0 100644
--- a/bl-kernel/dblanguage.class.php
+++ b/bl-kernel/dblanguage.class.php
@@ -5,6 +5,7 @@ class dbLanguage extends dbJSON
public $data;
public $db;
public $currentLanguage;
+ public $dates;
function __construct($currentLanguage)
{
@@ -30,6 +31,10 @@ class dbLanguage extends dbJSON
// Language-data
$this->data = $this->db['language-data'];
unset($this->db['language-data']);
+
+ // Dates
+ $this->dates = $this->db['dates'];
+ unset($this->db['dates']);
}
public function locale()
@@ -114,4 +119,10 @@ class dbLanguage extends dbJSON
}
return $tmp;
}
+
+ // Returns array with all the dates and months
+ public function getDates()
+ {
+ return $this->dates;
+ }
}
\ No newline at end of file
diff --git a/bl-kernel/helpers/date.class.php b/bl-kernel/helpers/date.class.php
index 171a2809..649bb8e7 100644
--- a/bl-kernel/helpers/date.class.php
+++ b/bl-kernel/helpers/date.class.php
@@ -12,14 +12,18 @@ class Date {
public static function current($format)
{
$Date = new DateTime();
- return $Date->format($format);
+ $output = $Date->format($format);
+
+ return Self::translate($output);
}
public static function currentOffset($format, $offset)
{
$Date = new DateTime();
$Date->modify($offset);
- return $Date->format($format);
+ $output = $Date->format($format);
+
+ return Self::translate($output);
}
// Format a local time/date according to locale settings.
@@ -29,7 +33,8 @@ class Date {
$Date = DateTime::createFromFormat($currentFormat, $date);
if ($Date!==false) {
- return $Date->format($outputFormat);
+ $output = $Date->format($outputFormat);
+ return Self::translate($output);
}
return false;
@@ -39,7 +44,22 @@ class Date {
{
$Date = DateTime::createFromFormat($currentFormat, $date);
$Date->setTimezone(new DateTimeZone('UTC'));
- return $Date->format($outputFormat);
+ $output = $Date->format($outputFormat);
+
+ return Self::translate($output);
+ }
+
+ public static function translate($date)
+ {
+ global $Language;
+
+ // If English default language don't translate
+ if ($Language->currentLanguage()=='en') {
+ return $date;
+ }
+
+ $dates = $Language->getDates();
+ return str_replace(array_keys($dates), array_values($dates), $date);
}
public static function timeago($time)
diff --git a/bl-kernel/url.class.php b/bl-kernel/url.class.php
index afa33d32..18faaccd 100644
--- a/bl-kernel/url.class.php
+++ b/bl-kernel/url.class.php
@@ -155,12 +155,12 @@ class Url
return 1;
}
- public function setNotFound($notFound=true, $httpCode=404, $httpMessage='Not Found')
+ public function setNotFound()
{
$this->setWhereAmI('page');
- $this->notFound = $notFound;
- $this->httpCode = $httpCode;
- $this->httpMessage = $httpMessage;
+ $this->notFound = true;
+ $this->httpCode = 404;
+ $this->httpMessage = 'Not Found';
}
public function httpCode()
diff --git a/bl-languages/en.json b/bl-languages/en.json
index 8229bb23..2932eba2 100644
--- a/bl-languages/en.json
+++ b/bl-languages/en.json
@@ -6,7 +6,46 @@
"last-update": "2017-10-14",
"author": "Bludit",
"email": "",
- "website": "https://www.bludit.com"
+ "website": "https://www.bludit.com"
+ },
+ "dates": {
+ "Mon": "Mon",
+ "Tue": "Tue",
+ "Wed": "Wed",
+ "Thu": "Thu",
+ "Fri": "Fri",
+ "Sat": "Sat",
+ "Sun": "Sun",
+ "Monday": "Monday",
+ "Tuesday": "Tuesday",
+ "Wednesday": "Wednesday",
+ "Thursday": "Thursday",
+ "Friday": "Friday",
+ "Saturday": "Saturday",
+ "Sunday": "Sunday",
+ "Jan": "Jan",
+ "Feb": "Feb",
+ "Mar": "Mar",
+ "Apr": "Apr",
+ "Jun": "Jun",
+ "Jul": "Jul",
+ "Aug": "Aug",
+ "Sep": "Sep",
+ "Oct": "Oct",
+ "Nov": "Nov",
+ "Dec": "Dec",
+ "January": "January",
+ "February": "February",
+ "March": "March",
+ "April": "April",
+ "May": "May",
+ "June": "June",
+ "July": "July",
+ "August": "August",
+ "September": "September",
+ "October": "October",
+ "November": "November",
+ "December": "December"
},
"dashboard": "Dashboard",
"manage-users": "Manage users",
diff --git a/bl-languages/es.json b/bl-languages/es.json
index 1604f89c..9813ee2f 100644
--- a/bl-languages/es.json
+++ b/bl-languages/es.json
@@ -8,6 +8,45 @@
"email": "",
"website": "https://www.bludit.com"
},
+ "dates": {
+ "Mon": "Lun",
+ "Tue": "Mar",
+ "Wed": "Mier",
+ "Thu": "Jue",
+ "Fri": "Vie",
+ "Sat": "Sab",
+ "Sun": "Dom",
+ "Monday": "Lunes",
+ "Tuesday": "Martes",
+ "Wednesday": "Miercoles",
+ "Thursday": "Jueves",
+ "Friday": "Viernes",
+ "Saturday": "Sabado",
+ "Sunday": "Domingo",
+ "Jan": "Ene",
+ "Feb": "Feb",
+ "Mar": "Mar",
+ "Apr": "Abr",
+ "Jun": "Jun",
+ "Jul": "Jul",
+ "Aug": "Ago",
+ "Sep": "Sep",
+ "Oct": "Oct",
+ "Nov": "Nov",
+ "Dec": "Dic",
+ "January": "Enero",
+ "February": "Febrero",
+ "March": "Marzo",
+ "April": "Abril",
+ "May": "Mayo",
+ "June": "Junio",
+ "July": "Julio",
+ "August": "Agosto",
+ "September": "Septiembre",
+ "October": "Octubre",
+ "November": "Noviembre",
+ "December": "Diciembre"
+ },
"dashboard": "Panel",
"manage-users": "Administrar usuarios",
"manage-categories": "Administrar categorías",
diff --git a/bl-plugins/backup/languages/en.json b/bl-plugins/backup/languages/en.json
index 033c7938..2ed99d90 100644
--- a/bl-plugins/backup/languages/en.json
+++ b/bl-plugins/backup/languages/en.json
@@ -2,6 +2,6 @@
"plugin-data":
{
"name": "Backup",
- "description": ""
+ "description": "The simple way to backup your Bludit."
}
}
\ No newline at end of file