New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tail.datetime

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tail.datetime - npm Package Compare versions

Comparing version 0.4.12 to 0.4.13

css/tail.datetime-default-blue.map

2

bower.json
{
"name": "tail.datetime",
"description": "A powerful, translat- and configurable DateTime Picker, written in Vanilla JavaScript without any dependencies!",
"description": "A powerful, extensive and configurable Date/Time Picker, written in Vanilla JavaScript without any dependencies!",
"keywords": [

@@ -5,0 +5,0 @@ "datetime-picker",

CHANGELOG
=========
Version 0.4.13 - Beta
---------------------
- Add: The new Polish Translation.
- Thanks to [Jacob273](https://github.com/Jacob273)
@ [#32](https://github.com/pytesNET/tail.DateTime/pull/32).
- Add: The new Spanish Mexican Translation.
- Thanks to [elPesecillo](https://github.com/elPesecillo)
@ [#34](https://github.com/pytesNET/tail.DateTime/issue/34).
- Add: The new Czech Translation.
- Thanks to [Milan Kyncl](https://github.com/milankyncl)
@ [#39](https://github.com/pytesNET/tail.DateTime/pull/39).
- Add: The new Greek Translation.
- Thanks to [tsakal](https://github.com/tsakal)
@ [#41](https://github.com/pytesNET/tail.DateTime/issues/41).
- Add: The new option `time12h` to use the AM/PM selector instead of the 24-h format.
- Thanks to [#23](https://github.com/pytesNET/tail.DateTime/issues/23).
- Add: Custom "stepUp" and "stepDown" buttons for the new time picker input fields.
- Add: The new internal methods `this.prepare()` and `this.handleStep()`.
- Update: The helper methods `cHAS()`, `cADD()` and `cREM()`.
- Update: Time Selector fields are now `text` fields instead of number, using `inputmode` to force
the number-selectors on mobile browsers (weak support).
- Update: Remove the initial inline styling of the DateTime container (use CSS instead).
- Update: Define factory-global `w` and `d` variables within the factory parameter declaration.
- Update: The options `timeHours`, `timeMinutes` and `timeSeconds` calculates now the time number
using the current time and the respective `timeStep*` value if `true` is passed.
- Update: The options `timeHours`, `timeMinutes` and `timeSeconds` hides the respective field if
`false` is used or just "disables" them by using `null`.
- Thanks to [#23](https://github.com/pytesNET/tail.DateTime/issues/23).
- Update: Use leading Zeros on the single time selectors.
- Thanks to [#23](https://github.com/pytesNET/tail.DateTime/issues/23).
- Remove: The `name` attributes from the Time input fields.
- Bugfix: The helper method `clone` use an IE-unsupported function called `Object.assign`.
- Bugfix: Webpack issue in VueJS.
- Thanks to [#35](https://github.com/pytesNET/tail.DateTime/issues/35).
- Bugfix: The `timeIncrement` function doesn't work by using the Arrow buttons on the respective
time input[type=number] fields.
- Bugfix: Dates before 1970-01-01 are disabled.
- Thanks to [#40](https://github.com/pytesNET/tail.DateTime/issues/40).
### CSS / Less Environment
- Add: A "not-allowed" cursor on disabled time fields / custom buttons.
- Add: Minified Stylesheets and Source Maps (for both types).
- Add: A node.js script to compile the Less stylesheets into CSS.
- Add: New design parts for the custom time buttons and the AM/PM switch.
- Update: The complete Less stylesheet structure.
- Update: A few design changes on both designs.
- Update: Each single CSS Color scheme contains now the complete styles instead of "imports".
- Update: Move `direction: rtl;` from inline CSS to CSS stylesheet property.
- Remove: All obsolete (not required) `-o-` and `-moz-` prefixed CSS properties.
- Bugfix: Date picker is not positioned properly in a child scrollable container.
- Thanks to [#33](https://github.com/pytesNET/tail.DateTime/issues/33).
Version 0.4.12 - Beta

@@ -12,5 +64,6 @@ ---------------------

---------------------
- Info: This is the first version, which drops IE 9 support!
- Add: The new Norwegian Translation. Many Thanks to [Lars Athle Larsen](https://github.com/larsathle)
[#31](https://github.com/pytesNET/tail.DateTime/pull/31)!
- Info: This is the first version, which drops IE 9 support.
- Add: The new Norwegian Translation.
- Thanks to [Lars Athle Larsen](https://github.com/larsathle)
@ [#31](https://github.com/pytesNET/tail.DateTime/pull/31).
- Add: Support for MooTools.

@@ -27,4 +80,5 @@ - Add: Global `window` implementation using `datetime`, next to the existing `DateTime`, variable.

---------------------
- Add: The new French Translation. Many Thanks to [Murat Pala](https://github.com/Prozexis)
[#30](https://github.com/pytesNET/tail.DateTime/pull/30)!
- Add: The new French Translation.
- Thanks to [Murat Pala](https://github.com/Prozexis)
@ [#30](https://github.com/pytesNET/tail.DateTime/pull/30).
- Bugfix: Use of undefined variable `datePart` in the `convertDate` method.

@@ -39,17 +93,20 @@ - Bugfix: The jQuery implementation has been fixed.

- Update: Should close (or test with stayopen) after submit time.
Thanks to: [#24](https://github.com/pytesNET/tail.DateTime/issues/24).
- Thanks to [#24](https://github.com/pytesNET/tail.DateTime/issues/24).
- Bugfix: Can't resolve '../tail.datetime-default.css'.
Thanks to: [#25](https://github.com/pytesNET/tail.DateTime/issues/25).
- Thanks to [#25](https://github.com/pytesNET/tail.DateTime/issues/25).
Version 0.4.8 - Beta
--------------------
- Add: The new French Translation. Many Thanks to [FlashPanther](https://github.com/FlashPanther)
[#19](https://github.com/pytesNET/tail.DateTime/pull/19)!
- Bugfix: Tooltips doesn't support date range [Pull Request]
Thanks to: [FlashPanther](/FlashPanther) @ [#20](https://github.com/pytesNET/tail.DateTime/issues/20)
- Add: The new French Translation.
- Thanks to [FlashPanther](https://github.com/FlashPanther)
@ [#19](https://github.com/pytesNET/tail.DateTime/pull/19).
- Bugfix: Tooltips doesn't support date range.
- Thanks to [FlashPanther](https://github.com/FlashPanther)
@ [#20](https://github.com/pytesNET/tail.DateTime/issues/20).
Version 0.4.7 - Beta
--------------------
- Add: The new Finish Translation. Many Thanks to [noxludio](https://github.com/noxludio)
[#17](https://github.com/pytesNET/tail.DateTime/pull/17)!
- Add: The new Finish Translation.
- Thanks to [noxludio](https://github.com/noxludio)
@ [#17](https://github.com/pytesNET/tail.DateTime/pull/17).

@@ -62,8 +119,9 @@ Version 0.4.6 - Beta

- Bugfix: When showing only time picker, the calendar label says undefined.
Thanks to: [#16](https://github.com/pytesNET/tail.DateTime/issues/16)
- Thanks to [#16](https://github.com/pytesNET/tail.DateTime/issues/16).
Version 0.4.5 - Beta
--------------------
- Add: The new Dutch Translation. Many Thanks to [mickeybyte](https://github.com/mickeybyte)
[#15](https://github.com/pytesNET/tail.DateTime/issues/15)!
- Add: The new Dutch Translation.
- Thanks to [mickeybyte](https://github.com/mickeybyte)
@ [#15](https://github.com/pytesNET/tail.DateTime/issues/15).
- Add: Increase and Loop the Time fields by clicking Up and Down.

@@ -77,15 +135,17 @@ - Add: The new option `timeIncrement`, which increase the next unit on loop of the previous one.

--------------------
- Remove: The `project.synder` file until the new Synder Format is finished!
- Bugfix: CDN / NPM Hotfix (because I uploaded the wrong branch to NPM)!
- Remove: The `project.synder` file until the new Synder Format is finished.
- Bugfix: CDN / NPM Hotfix (because I uploaded the wrong branch to NPM).
Version 0.4.3 - Beta
--------------------
- Add: The new Italian Translation. Many Thanks to [Fabio Di Stasio](https://github.com/Fabio286)
[#10](https://github.com/pytesNET/tail.DateTime/issues/10)!
- Add: The new Brazilian Portuguese Translation. Many Thanks to [Júnior Garcia](https://github.com/juniorgarcia)
[#10](https://github.com/pytesNET/tail.DateTime/issues/13)!
- Add: The new Italian Translation.
- Thanks to [Fabio Di Stasio](https://github.com/Fabio286)
@ [#10](https://github.com/pytesNET/tail.DateTime/issues/10).
- Add: The new Brazilian Portuguese Translation.
- Thanks to [Júnior Garcia](https://github.com/juniorgarcia)
@ [#13](https://github.com/pytesNET/tail.DateTime/issues/13).
- Add: The new options `timeStep*` to change the step size of the input fields.
Thanks to: [#9](https://github.com/pytesNET/tail.DateTime/issues/9)
- Thanks to [#9](https://github.com/pytesNET/tail.DateTime/issues/9).
- Bugfix: Error in dateRanges visualization
Thanks to: [#12](https://github.com/pytesNET/tail.DateTime/issues/12)
- Thanks to [#12](https://github.com/pytesNET/tail.DateTime/issues/12).

@@ -96,14 +156,15 @@ Version 0.4.2 - Beta

- Update: The `.register()` method checks now if locale is a string and object a object.
- Update: The `.register()` method returns now `true` on success and `false` on failure!
- Update: The `.register()` method returns now `true` on success and `false` on failure.
- Bugfix: The `.selectTime()` method didn't used the "already select / current viewed" date.
- Bugfix: Changing time has no effect.
Thanks to: [#5](https://github.com/pytesNET/tail.DateTime/issues/5)
- Thanks to [#5](https://github.com/pytesNET/tail.DateTime/issues/5).
- Bugfix: Calculations are wrong in some Environments.
Thanks to: [#6](https://github.com/pytesNET/tail.DateTime/issues/6),
**Fixed by:** AndrewDRX @ [#8](https://github.com/pytesNET/tail.DateTime/pull/8)
- Thanks to [AndrewDRX](https://github.com/AndrewDRX)
@ [#6](https://github.com/pytesNET/tail.DateTime/issues/6).
Version 0.4.1 - Beta
--------------------
- Add: The new Arabic Translation. Many Thanks to [Mohammed Alsiddeeq Ahmed](https://github.com/mosid)
[#1](https://github.com/pytesNET/tail.DateTime/issues/1)!
- Add: The new Arabic Translation.
- Thanks to [Mohammed Alsiddeeq Ahmed](https://github.com/mosid)
@ [#1](https://github.com/pytesNET/tail.DateTime/issues/1).
- Add: The new option `rtl`, which allows to display the DateTime picker in an RTL style.

@@ -114,17 +175,17 @@ - Add: The new event `view`.

- Update: The "Enter/Escape" Key listener now also works when the cursor is within an input field.
- Update: The events now gets fired AFTER the DateTime picker has done his actions!
- Update: The events now gets fired AFTER the DateTime picker has done his actions.
- Bugfix: Disabled dates could still be selected / clicked.
- Bugfix: The `keyup` document event listener has fired per instance.
- Bugfix: The "Enter" Key listener doesn't notice / used already selected dates!
- Bugfix: The "Enter" Key listener doesn't notice / used already selected dates.
- Bugfix: You cannot go back farther than to February of the displayed year.
[#3](https://github.com/pytesNET/tail.DateTime/issues/3)!
- Thanks to [#3](https://github.com/pytesNET/tail.DateTime/issues/3).
- Bugfix: Issue with Date Selection with Update to 0.4.0.
[#2](https://github.com/pytesNET/tail.DateTime/issues/2)!
- Thanks to [#2](https://github.com/pytesNET/tail.DateTime/issues/2).
Version 0.4.0 - Beta
--------------------
- Info: This is the first BETA version! :3
- Info: This is the first BETA version. :3
- Info: This Repository is now completely independent, due to the removal of the last original
lines of MrGuiseppes pureJSCalendar script!
- Add: Russian translation (ru).
lines of MrGuiseppes pureJSCalendar script.
- Add: Russian translation (Thanks to my workmate).
- Add: Designs in LESS Format (I'm new at this Pre-Processing Stuff :/).

@@ -151,26 +212,26 @@ - Add: Support as Asynchronous Module Definition.

- Add: The new internal render and view methods `.renderCalendar()`, `.renderDatePicker()`,
`.renderTimePicker()`,`.viewDecades()`, `.viewYears()`, `.viewMonths()`, `.viewDays()`,
`.handleLabel()`, `.showTooltip()` and `.hideTooltip()`.
`.renderTimePicker()`,`.viewDecades()`, `.viewYears()`, `.viewMonths()`, `.viewDays()`,
`.handleLabel()`, `.showTooltip()` and `.hideTooltip()`.
- Add: The new public method `.config()` to get and set settings during the runtime.
- Add: The new public methods `.switchView()`, `.browseView()`, `.switchDate()` and `.fetchDate()`
to control the calendar interface and fetch the current Date.
to control the calendar interface and fetch the current Date.
- Add: The new public methods `.appendTooltip()` and `.appendRange()` to append tooltips and date
ranges during the runtime.
ranges during the runtime.
- Update: The translations itself, as well as the translation / locale system behind.
- Update: Both designs has been updated to the new structure.
- Update: The main helper methods.
- Update: The calendar render process has been re-written, now it will always show 6 rows of
dates, including days from the previous and next month!
- Update: The locale system is now usable per instance, the strings doesn't get replaced!
- Update: The option `classNames` allows now `true` to copy the class names from the main
element and false, to do nothing.
- Update: The option `position` and `static` has been merged, so use "top", "left", "right" or
or "bottom" to show the calendar on an absolute position relative to the passed element
or pass any selector, which should be used as container.
- Update: The option `weekStart` supports now also numbers (SUN = 0, MON = 1, ... SAT = 6)!
- Update: The option `dateRange` requires now a new range format, the old one is NOT supported!
- Update: The calendar render process has been re-written, now it will always show 6 rows of dates,
including days from the previous and next month.
- Update: The locale system is now usable per instance, the strings doesn't get replaced.
- Update: The option `classNames` allows now `true` to copy the class names from the main element
and false, to do nothing.
- Update: The option `position` and `static` has been merged, so use "top", "left", "right"
or "bottom" to show the calendar on an absolute position relative to the passed element or pass
any selector, which should be used as container.
- Update: The option `weekStart` supports now also numbers (SUN = 0, MON = 1, ... SAT = 6).
- Update: The option `dateRange` requires now a new range format, the old one is NOT supported.
- Update: The public methods `.switchMonth()` and `switchYear()` now just aliases for the main
public method `.switchDate()`.
public method `.switchDate()`.
- Update: The public methods `.open()` and `.close()` now using `setTimeout()` instead of an
interval.
interval.
- Update: The public methods `.reload()` reloads the same instance instead of creating a new one.

@@ -183,3 +244,3 @@ - Update: The public event method `.on()` has been updated and supports now a third argument.

- Remove: The old render functions `.renderDay()`, `.renderMonth()` and `.renderTime()` has been
replaced by the new `.view*()` and `.render*()` methods!
replaced by the new `.view*()` and `.render*()` methods.
- Remove: The `.createCalendar()` method has been replaced by the new `.view*()` methods.

@@ -204,3 +265,4 @@ - Bugfix: The `tbdy` typo has been fixed.

- BugFix: `Enter` / `Return` executes all events, even if just one field is in focus.
- Removed: The `dateRange` fallback option has been removed, to clean the source up for the next major version.
- Removed: The `dateRange` fallback option has been removed, to clean the source up for the next
major version.

@@ -210,8 +272,10 @@ Version 0.3.2 - Alpha

- Info: npmJS Version Fix.
- Add: Spanish translation
- Add: Spanish translation (Thanks to my workmate).
Version 0.3.1 - Alpha
---------------------
- BugFix: Position Absolute doesn't recalculate [#2](https://github.com/pytesNET/tail.DateTime/issues/2)
- BugFix: Today on every Year! [#1](https://github.com/pytesNET/tail.DateTime/issues/1)
- BugFix: Position Absolute doesn't recalculate.
- Thanks to [#2](https://github.com/pytesNET/tail.DateTime/issues/2).
- BugFix: Today on every Year.
- Thanks to [#1](https://github.com/pytesNET/tail.DateTime/issues/1).

@@ -222,3 +286,4 @@ Version 0.3.0 - Alpha

- Add: A minified version, minified with [jsCompress](https://jscompress.com/).
- Add: A new "white" design, used with `tail.datetime.white.css` (together with the main style sheet).
- Add: A new "white" design, used with `tail.datetime.white.css` (together with the main style
sheet).
- Add: A new `span` HTML element wraps each single day number.

@@ -238,3 +303,4 @@ - Add: Events for `open`, `close` and `select` (used with `tail.DateTime::` prefix).

- Update: All SVG images has been changed into the Octicon vector graphics.
- Update: The constructor allows now `NodeList`s and `HTMLCollection`s and uses `querySelectorAll` on strings.
- Update: The constructor allows now `NodeList`s and `HTMLCollection`s and uses `querySelectorAll`
on strings.
- Update: Renamed any `data-fox-*` attribute names into `data-tail-*`.

@@ -245,4 +311,6 @@ - Update: The internal `element` input variable has renamed into `e`.

- Update: The internal `view` / `current` variables has been merged under `view`.
- Update: The internal `select` variable holds the last (current) selected Date and Time as Date object.
- Update: The option `dateRange` has renamed into `dateRanges` and allows multiple arrays with Date Objects, Date Values (YYYY-mm-dd) and Week-Day names.
- Update: The internal `select` variable holds the last (current) selected Date and Time as Date
object.
- Update: The option `dateRange` has renamed into `dateRanges` and allows multiple arrays with
Date Objects, Date Values (YYYY-mm-dd) and Week-Day names.
- BugFix: Current Date object has been shared between each prototype instance.

@@ -259,3 +327,3 @@

- Add: Calendar Class Names `calendar-close`, `calendar-idle`, `calendar-open`.
- Update: Changed '\‹' and '\›' into SVG background images.
- Update: Changed `‹` and `›` into SVG background images.
- Update: Stores now a (current) Date Object instead of the year / month number.

@@ -269,7 +337,7 @@ - Update: Some minimalistic style and script changes.

---------------------
- Update: Change Calendar Counter Calculation (CCCC)
- Update: Return `this` on the public methods
- Update: Change Calendar Counter Calculation (CCCC).
- Update: Return `this` on the public methods.
Version 0.1.0 - Alpha
---------------------
- Initial Release (Fork of Pure JS Calendar](https://github.com/MrGuiseppe/pureJSCalendar))
- Initial Release (Fork of [Pure JS Calendar](https://github.com/MrGuiseppe/pureJSCalendar)).
/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./js/tail.datetime-full.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -13,5 +13,5 @@ | @website https://github.com/pytesNET/tail.DateTime

if(typeof define === "function" && define.amd){
define(function(){ return factory(root); });
define(function(){ return factory(root, root.document); });
} else if(typeof module === "object" && module.exports){
module.exports = factory(root);
module.exports = factory(root, root.document);
} else {

@@ -21,3 +21,3 @@ if(typeof root.tail === "undefined"){

}
root.tail.DateTime = root.tail.datetime = factory(root);
root.tail.DateTime = root.tail.datetime = factory(root, root.document);

@@ -39,15 +39,15 @@ // jQuery Support

}
}(this, function(root){
}(window, function(w, d){
"use strict";
var w = root, d = root.document;
d.forms.inputmode = true;
// Internal Helper Methods
function cHAS(el, name){
return (!el.classList)? false: el.classList.contains(name);
return (el && "classList" in el)? el.classList.contains(name): false;
}
function cADD(el, name){
return (!el.classList)? false: (el.classList.add(name))? el: el;
return (el && "classList" in el)? el.classList.add(name): undefined;
}
function cREM(el, name){
return (!el.classList)? false: (el.classList.remove(name))? el: el;
return (el && "classList" in el)? el.classList.remove(name): undefined;
}

@@ -64,5 +64,19 @@ function trigger(el, event, opt){

function clone(obj, rep){
return Object.assign({}, obj, rep || {});
if(typeof Object.assign === "function"){
return Object.assign({}, obj, rep || {});
}
var clone = Object.constructor();
for(var key in obj){
clone[key] = (key in rep)? rep[key]: obj[key];
}
return clone;
}
function first(str){ return str.charAt(0).toUpperCase() + str.slice(1); };
function create(tag, classes){
var r = d.createElement(tag);
r.className = (classes && classes.join)? classes.join(" "): classes || "";
return r;
}
function first(str){
return str.charAt(0).toUpperCase() + str.slice(1);
}
function parse(str, time, reset){

@@ -75,3 +89,3 @@ var date = (str instanceof Date)? str: (str)? new Date(str): false;

return (time === true)? date.getTime(): date;
};
}

@@ -96,3 +110,3 @@ /*

// Check el
// Check Element
if(datetime.inst[el.getAttribute("data-tail-datetime")]){

@@ -113,5 +127,6 @@ return datetime.inst[el.getAttribute("data-tail-datetime")];

datetime.inst["tail-" + this.id] = this;
this.e.setAttribute("data-tail-datetime", "tail-" + this.id);
return this.init();
};
datetime.version = "0.4.12";
datetime.version = "0.4.13";
datetime.status = "beta";

@@ -125,31 +140,32 @@ datetime.count = 0;

datetime.defaults = {
animate: true,
classNames: false,
closeButton: true,
dateFormat: "YYYY-mm-dd",
dateStart: false,
dateRanges: [],
dateBlacklist: true,
dateEnd: false,
locale: "en",
position: "bottom",
rtl: "auto",
startOpen: false,
stayOpen: false,
timeFormat: "HH:ii:ss",
timeHours: null,
timeMinutes: null,
timeSeconds: 0,
timeIncrement: true,
timeStepHours: 1,
timeStepMinutes: 5,
timeStepSeconds: 5,
today: true,
tooltips: [],
viewDefault: "days",
viewDecades: true,
viewYears: true,
viewMonths: true,
viewDays: true,
weekStart: 0
animate: true, // [0.4.0] Boolean
classNames: false, // [0.3.0] Boolean, String, Array, null
closeButton: true, // [0.4.5] Boolean
dateFormat: "YYYY-mm-dd", // [0.1.0] String (PHP similar Date)
dateStart: false, // [0.4.0] String, Date, Integer, False
dateRanges: [], // [0.3.0] Array
dateBlacklist: true, // [0.4.0] Boolean
dateEnd: false, // [0.4.0] String, Date, Integer, False
locale: "en", // [0.4.0] String
position: "bottom", // [0.1.0] String
rtl: "auto", // [0.4.1] String, Boolean
startOpen: false, // [0.3.0] Boolean
stayOpen: false, // [0.3.0] Boolean
time12h: false, // [0.4.13][NEW] Boolean
timeFormat: "HH:ii:ss", // [0.1.0] String (PHP similar Date)
timeHours: true, // [0.4.13][UPD] Integer, Boolean, null
timeMinutes: true, // [0.4.13][UPD] Integer, Boolean, null
timeSeconds: 0, // [0.4.13][UPD] Integer, Boolean, null
timeIncrement: true, // [0.4.5] Boolean
timeStepHours: 1, // [0.4.3] Integer
timeStepMinutes: 5, // [0.4.3] Integer
timeStepSeconds: 5, // [0.4.3] Integer
today: true, // [0.4.0] Boolean
tooltips: [], // [0.4.0] Array
viewDefault: "days", // [0.4.0] String
viewDecades: true, // [0.4.0] Boolean
viewYears: true, // [0.4.0] Boolean
viewMonths: true, // [0.4.0] Boolean
viewDays: true, // [0.4.0] Boolean
weekStart: 0 // [0.1.0] String, Integer
};

@@ -168,2 +184,9 @@

},
cs: {
months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"],
shorts: ["NE", "PO", "ÚT", "ST", "ČT", "PÁ", "SO"],
time: ["Hodiny", "Minuty", "Sekundy"],
header: ["Vyberte měsíc", "Vyberte rok", "Vyberte desetiletí", "Vyberte čas"]
},
de: {

@@ -183,2 +206,9 @@ months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],

},
el: {
months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"],
shorts: ["ΚΥΡ", "ΔΕΥ", "ΤΡΙ", "ΤΕΤ", "ΠΕΜ", "ΠΑΡ", "ΣΑΒ"],
time: ["Ώρες", "Λεπτά", "Δευτερόλεπτα"],
header: ["Επιλογή Μηνός", "Επιλογή Έτους", "Επιλογή Δεκαετίας", "Επιλογή Ώρας"]
},
en: {

@@ -198,2 +228,9 @@ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],

},
es_MX: {
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
shorts: ["DO", "LU", "MA", "MI", "JU", "VI", "SÁ"],
time: ["Horas", "Minutos", "Segundos"],
header: ["Selecciona un Mes", "Selecciona un Año", "Selecciona una Decada", "Selecciona la Hora"]
},
fi: {

@@ -234,2 +271,9 @@ months: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"],

},
pl: {
months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
shorts: ["ND", "PN", "WT", "ŚR", "CZW", "PT", "SOB"],
time: ["Godzina", "Minuta", "Sekunda"],
header: ["Wybierz miesiąc", "Wybierz rok", "Wybierz dekadę", "Wybierz czas"]
},
pt_BR: {

@@ -284,13 +328,67 @@ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],

| INTERNAL :: INIT CALENDAR
| @sicne 0.4.11 [0.2.0]
| @since 0.4.13 [0.2.0]
*/
init: function(){
var self = this, temp;
var self = this.prepare();
// Options
// Init Weekdays
var week = this.__["shorts"].slice(this.con.weekStart).concat(this.__["shorts"].slice(0, this.con.weekStart));
this.weekdays = "<thead>\n<tr>\n";
for(var i = 0; i < 7; i++){
this.weekdays += '<th class="calendar-week">' + week[i] + '</th>';
}
this.weekdays += "\n</tr>\n</thead>"
// Init Select
this.select = parse(this.e.getAttribute("data-value") || this.e.value);
if(!this.select || this.select < this.con.dateStart || this.select > this.con.dateEnd){
this.select = null;
}
// Init View
if(this.view == undefined){
this.view = {
type: this.con.viewDefault,
date: this.select || new Date()
};
}
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
if(typeof this.con["time" + l[i]] === "number"){
this.view.date["set" + l[i]](this.con["time" + l[i]]);
} else {
while(this.view.date["get" + l[i]]() % this.con["timeStep" + l[i]] !== 0){
this.view.date["set" + l[i]](this.view.date["get" + l[i]]() + 1);
}
}
}
this.ampm = this.view.date.getHours() > 12;
// Init Mains
this.events = {};
this.dt = this.renderCalendar();
// Store Instance and Return
if(this.con.startOpen){
this.open();
}
if(this.select){
this.selectDate(this.select);
}
return this.bind();
},
/*
| INTERNAL :: PREPARE CALENDAR
| @since 0.4.13 [0.4.13]
*/
prepare: function(){
this.__ = clone(datetime.strings.en, datetime.strings[this.con.locale] || {});
this.con.dateStart = parse(this.con.dateStart, true, true) || 0;
// Prepare Options
this.con.dateStart = parse(this.con.dateStart, true, true) || -9999999999999;
this.con.dateEnd = parse(this.con.dateEnd, true, true) || 9999999999999;
this.con.viewDefault = (!this.con.dateFormat)? "time": this.con.viewDefault;
if(typeof this.con.weekStart == "string"){
// Prepare Week Start
if(typeof this.con.weekStart === "string"){
this.con.weekStart = datetime.strings.en.shorts.indexOf(this.con.weekStart);

@@ -337,3 +435,3 @@ }

// Prepare Tooltips
// Preare Tooltips
if(this.con.tooltips.length > 0){

@@ -368,47 +466,28 @@ for(var r = [], t = this.con.tooltips, l = t.length, i = 0, s, e; i < l; i++){

}
return this;
},
// Prepare WeekDays
var week = this.__["shorts"].slice(this.con.weekStart).concat(this.__["shorts"].slice(0, this.con.weekStart));
this.weekdays = "<thead>\n<tr>\n";
for(var i = 0; i < 7; i++){
this.weekdays += '<th class="calendar-week">' + week[i] + '</th>';
}
this.weekdays += "\n</tr>\n</thead>"
/*
| INTERNAL :: BIND CALENDAR
| @since 0.4.13 [0.4.0]
*/
bind: function(){
var self = this;
// Set Main Data and Render
this.select = parse(this.e.getAttribute("data-value") || this.e.value);
if(!this.select || this.select < this.con.dateStart || this.select > this.con.dateEnd){
this.select = null;
}
if(this.view == undefined){
this.view = {
type: this.con.viewDefault,
date: this.select || new Date()
};
}
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
if(typeof this.con["time" + l[i]] == "number"){
this.view.date["set" + l[i]](this.con["time" + l[i]]);
}
}
this.events = {};
this.dt = this.renderCalendar();
// Hook Events
if(this._bind == undefined){
var e = "addEventListener";
this.e[e]("focusin", function(event){
// Bind Element
if(typeof this._bind === "undefined"){
this.e.addEventListener("focusin", function(event){
self.open.call(self);
});
this.e[e]("keyup", function(event){
self.bind.call(self, event);
this.e.addEventListener("keyup", function(event){
self.callback.call(self, event);
});
d[e]("keyup", function(event){
d.addEventListener("keyup", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
}
});
d[e]("click", function(event){
d.addEventListener("click", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
} else if(!self.e.contains(event.target) && cHAS(self.dt, "calendar-open")){

@@ -420,5 +499,5 @@ if(event.target != self.dt && event.target != self.e && !self.con.stayOpen){

});
d[e]("mouseover", function(event){
d.addEventListener("mouseover", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
}

@@ -428,11 +507,2 @@ });

}
// Store Instance and Return
this.e.setAttribute("data-tail-datetime", "tail-" + this.id);
if(this.con.startOpen){
this.open();
}
if(this.select){
this.selectDate(this.select);
}
return this;

@@ -442,10 +512,10 @@ },

/*
| INTERNAL :: EVENT LISTENER
| @since 0.4.1 [0.4.0]
| INTERNAL :: HANDLE CALLBACKs
| @since 0.4.13 [0.4.13]
*/
bind: function(event){
callback: function(event){
var self = event.target, a = "getAttribute", d = "data-action", v = "data-view",
elem = self[a](d)? self: self.parentElement[a](d)? self.parentElement: self;
elem = self[a](d)? self: self.parentElement[a](d)? self.parentElement: self;
// Hover Events
// Bind HoverEvents
var t = "data-tooltip", tip;

@@ -462,3 +532,3 @@ if(event.type == "mouseover"){

// Click Events
// Bind ClickEvents
if(event.type == "click"){

@@ -475,2 +545,3 @@ if(!elem || (event.buttons != 1 && (event.which || event.button) != 1)){

return this.browseView(elem[a](d));
case "cancel":

@@ -481,2 +552,3 @@ if(!this.con.stayOpen){

break;
case "submit":

@@ -487,2 +559,3 @@ if(!this.con.stayOpen){

return this.selectDate(this.fetchDate(parseInt(elem[a]("data-date"))));
case "view":

@@ -494,3 +567,3 @@ this.switchDate(elem[a]("data-year") || null, elem[a]("data-month") || null, elem[a]("data-day") || null);

// KeyEvents
// Bind KeyEvents
if(event.type == "keyup"){

@@ -538,3 +611,3 @@ if(event.target.tagName != "INPUT" && event.target !== this.e){

| HELPER :: CALCULATE POSITION
| @since 0.4.2 [0.3.1]
| @since 0.4.13 [0.3.1]
*/

@@ -545,12 +618,10 @@ calcPosition: function(){

y = parseInt(b.marginTop) +parseInt(b.marginBottom),
p = (function(e, r){
r = {
top: e.offsetTop || 0, left: e.offsetLeft || 0,
width: e.offsetWidth || 0, height: e.offsetHeight || 0
};
while(e = e.offsetParent){ r.top += e.offsetTop; r.left += e.offsetLeft; }
return r;
})(this.e, {});
p = {
top: this.e.getBoundingClientRect().top + w.scrollY,
left: this.e.getBoundingClientRect().left - w.scrollX,
width: this.e.offsetWidth || 0,
height: this.e.offsetHeight || 0
};
// Set Position
// Calc Position
a.visibility = "hidden";

@@ -563,7 +634,7 @@ switch(this.con.position){

case "left":
var top = (p.top + p.height/2) - (this.dt.offsetHeight / 2 + y),
var top = (p.top + p.height / 2) - (this.dt.offsetHeight / 2 + y),
left = p.left - (this.dt.offsetWidth + x);
break;
case "right":
var top = (p.top + p.height/2) - (this.dt.offsetHeight / 2 + y),
var top = (p.top + p.height / 2) - (this.dt.offsetHeight / 2 + y),
left = p.left + p.width;

@@ -576,2 +647,4 @@ break;

}
// Set Position
a.top = ((top >= 0)? top: this.e.offsetTop) + "px";

@@ -616,43 +689,43 @@ a.left = ((left >= 0)? left: 0) + "px";

| RENDER :: CALENDAR
| @since 0.4.5 [0.4.0]
| @since 0.4.13 [0.4.0]
*/
renderCalendar: function(){
var _s, _c = ["tail-datetime-calendar", "calendar-close"], dt = d.createElement("DIV"),
_t = (this.con.classNames === true)? this.e.className: this.con.classNames;
var cls = ["tail-datetime-calendar", "calendar-close"],
cus = (this.con.classNames === true)? this.e.className.split(" "): this.con.classNames;
// Configure Calendar
// Classes
if(["top", "left", "right", "bottom"].indexOf(this.con.position) < 0){
_s = d.querySelector(this.con.position);
_c.push("calendar-static");
var sta = d.querySelector(this.con.position);
cls.push("calendar-static");
}
if(typeof _t == "string" || _t instanceof Array){
_c = _c.concat(((typeof _t == "string")? _t.split(" "): _t));
if(this.con.rtl === true || ["ar", "he", "mdr", "sam", "syr"].indexOf(this.con.rtl) >= 0){
cls.push("rtl");
}
var rtl = ["ar", "he", "mdr", "sam", "syr"], _rt = this.con.rtl;
if(_rt === true || (_rt === "auto" && rtl.indexOf(this.con.locale) >= 0)){
_c.push("rtl");
}
if(this.con.stayOpen){
_c.push("calendar-stay");
cls.push("calendar-stay");
}
// Customs
cus = (typeof cus.split === "function")? cus.split(" "): cus;
if(cus instanceof Array){
cls = cls.concat(cus);
}
// Create
var dt = create("DIV", cls), ins = false;
dt.id = "tail-datetime-" + this.id;
dt.className = _c.join(" ");
dt.style.cssText = (this.con.rtl)? "direction:rtl;": "direction:ltr;";
// Render Action
// Render Actions
if(this.con.dateFormat){
var _a = '<span class="action action-prev" data-action="prev"></span>'
+ '<span class="label" data-action="view" data-view="up"></span>'
+ '<span class="action action-next" data-action="next"></span>'
ins = '<span class="action action-prev" data-action="prev"></span>'
+ '<span class="label" data-action="view" data-view="up"></span>'
+ '<span class="action action-next" data-action="next"></span>';
} else if(this.con.timeFormat){
var _a = '<span class="action action-submit" data-action="submit"></span>'
+ '<span class="label"></span>'
+ '<span class="action action-cancel" data-action="cancel"></span>'
ins = '<span class="action action-submit" data-action="submit"></span>'
+ '<span class="label"></span>'
+ '<span class="action action-cancel" data-action="cancel"></span>';
}
if(typeof _a != "undefined"){
dt.innerHTML = '<div class="calendar-actions">' + _a + '</div>';
}
dt.innerHTML = (ins)? '<div class="calendar-actions">' + ins + '</div>': '';
// Render Date and Time Picker
// Render Interfaces
if(this.con.dateFormat){

@@ -665,6 +738,5 @@ this.renderDatePicker(dt, this.con.viewDefault);

// Render Close Button
if(this.con.closeButton && !_s){
var close = d.createElement("BUTTON"), self = this;
close.className = "calendar-close";
// Render Close
if(this.con.closeButton && !sta){
var close = create("BUTTON", "calendar-close"), self = this;
close.addEventListener("click", function(event){

@@ -678,8 +750,3 @@ event.preventDefault();

// Append Calendar
if(_s){
dt.style.cssText = 'position:static;visibility:visible;';
} else {
dt.style.cssText = 'top:0;left:0;z-index:999;position:absolute;visibility:hidden;';
}
(_s || document.body).appendChild(dt);
(sta || d.body).appendChild(dt);
return dt;

@@ -716,72 +783,157 @@ },

| RENDER :: TIME PICKER
| @since 0.4.5 [0.4.0]
| @since 0.4.13 [0.4.0]
*/
renderTimePicker: function(dt){
if(!this.con.timeFormat){ return false; }
var h = this.con.timeStepHours, m = this.con.timeStepMinutes, s = this.con.timeStepSeconds;
h ='<div class="timepicker-field timepicker-hours">'
+ '<input type="number" name="dt[h]" value="" min="00" max="23" step="' + h + '" />'
+ '<label>' + this.__["time"][0] + '</label>'
+ '</div>',
m = '<div class="timepicker-field timepicker-minutes">'
+ '<input type="number" name="dt[m]" value="" min="00" max="59" step="' + m + '" />'
+ '<label>' + this.__["time"][1] + '</label>'
+ '</div>',
s = '<div class="timepicker-field timepicker-seconds">'
+ '<input type="number" name="dt[s]" value="" min="00" max="59" step="' + s + '" />'
+ '<label>' + this.__["time"][2] + '</label>'
+ '</div>';
if(!this.con.timeFormat){
return false;
}
var fields = [], input, i = 0;
// AM | PM Switch
if(this.con.time12h){
var checked = (this.view.date.getHours() > 12)? 'checked="checked" ': '';
fields.push(
'<label class="timepicker-switch" data-am="AM" data-pm="PM">' +
'<input type="checkbox" value="1" data-input="PM" ' + checked + '/><span></span>' +
'</label>'
);
}
// Hours & Minutes & Seconds
for(var key in { Hours: 0, Minutes: 0, Seconds: 0 }){
if(this.con["time" + key] === false){
fields.push((i++)? null: null);
continue;
}
input = d.createElement("INPUT");
input.type = "text";
input.disabled = (this.con["time" + key] === null);
input.setAttribute("min", (key === "Hours" && this.con.time12h)? "01": "00");
input.setAttribute("max", (key !== "Hours")? "60": (this.con.time12h)? "13": "24");
input.setAttribute("step", this.con["timeStep" + key]);
input.setAttribute("value", function(n){ return (n < 10)? "0" + n: n; }(this.view.date["get" + key]()));
input.setAttribute("pattern", "\d*");
input.setAttribute("inputmode", "numeric");
input.setAttribute("data-input", key.toLowerCase());
fields.push(
'<div class="timepicker-field timepicker-' + key.toLowerCase() + '">' +
input.outerHTML +
'<button class="picker-step step-up"></button>' +
'<button class="picker-step step-down"></button>' +
'<label>' + this.__["time"][i++] + '</label>' +
'</div>'
);
}
// Render View
var div = d.createElement("DIV");
div.className = "calendar-timepicker";
div.innerHTML = h + m + s;
var div = create("DIV", "calendar-timepicker"), self = this;
div.innerHTML = fields.join("\n");
// Set Data
var self = this, inp = div.querySelectorAll("input");
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
inp[i].value = this.view.date["get" + l[i]]();
inp[i].disabled = (this.con["time" + l[i]] === false);
inp[i].addEventListener("input", function(ev){ self.handleTime.call(self, ev, this) });
inp[i].addEventListener("keydown", function(ev){ self.handleTime.call(self, ev, this) });
// Bind Input
for(var inp = div.querySelectorAll("input"), i = 0; i < inp.length; i++){
if(inp[i].type === "checkbox"){
inp[i].addEventListener("change", function(ev){
self.handleTime.call(self, this);
});
continue;
}
inp[i].addEventListener("input", function(ev){
self.handleTime.call(self, this);
});
inp[i].addEventListener("keydown", function(ev){
var key = event.keyCode || event.which || 0;
if(key === 38 || key === 40){
ev.preventDefault();
self.handleStep.call(self, this, (key === 38? "up": "down"));
return false;
}
});
}
// Bind Buttons
for(var inp = div.querySelectorAll("button"), i = 0; i < inp.length; i++){
inp[i].addEventListener("mousedown", function(ev){
ev.preventDefault();
var input = this.parentElement.querySelector("input");
self.handleStep.call(self, input, cHAS(this, "step-up")? "up": "down");
return false;
});
}
// Append Element
if(dt.querySelector(".calendar-timepicker")){
dt.replaceChild(div, dt.querySelector(".calendar-timepicker"));
var ct = dt.querySelector(".calendar-timepicker");
dt[(ct)? "replaceChild": "appendChild"](div, ct);
return this.handleLabel(dt);
},
/*
| HANDLE :: TIME FIELD
| @since 0.4.13 [0.4.5]
*/
handleTime: function(input){
if(this.con.time12h && input.type === "checkbox"){
this.ampm = input.checked;
}
// Select Time
var time = input.parentElement.parentElement;
time = [
(time.querySelector("input[data-input=hours]") || {value: 0}),
(time.querySelector("input[data-input=minutes]") || {value: 0}),
(time.querySelector("input[data-input=seconds]") || {value: 0})
];
this.selectTime(
parseInt(time[0].value) + (this.ampm? 12: 0),
parseInt(time[1].value),
parseInt(time[2].value)
);
// Handle Values
time[2].value = this.view.date.getSeconds();
time[1].value = this.view.date.getMinutes();
if(this.con.time12h){
time[0].value = (this.view.date.getHours() > 12)? this.view.date.getHours() - 12: this.view.date.getHours();
} else {
dt.appendChild(div);
time[0].value = this.view.date.getHours();
}
return this.handleLabel(dt);
},
/*
| HANDLE :: TIME FIELDs
| @since 0.4.5 [0.4.5]
| HANDLE :: TIME STEPs
| @since 0.4.13 [0.4.13]
*/
handleTime: function(event, element){
var min = parseInt(element.getAttribute("min")),
max = parseInt(element.getAttribute("max")),
step = parseInt(element.getAttribute("step")),
value = parseInt(element.value), action = "none";
handleStep: function(input, action, prevent){
var inc = false;
var name = input.getAttribute("data-input");
var step = this.con["timeStep" + first(name)];
var value = parseInt(input.value);
var limit = (name !== "hours")? 60: (this.con.time12h)? 13: 24;
if((event.keyCode || event.which) == 38 || value > max){
var action = "up";
} if((event.keyCode || event.which) == 40 || value < min){
var action = "down";
// Calculate
if(action === "up" && value + step >= limit){
inc = this.con.timeIncrement && limit === 60;
input.value = (limit === 13)? 1: 0;
this.ampm = (this.view.date.getHours() + 1) >= 12;
} else if(action === "down" && value - step < (limit === 13? 1: 0)){
inc = this.con.timeIncrement && limit === 60;
input.value = limit - step;
this.ampm = (this.view.date.getHours() - 1) <= 0;
} else {
input.value = (action === "up")? value + step: value - step;
}
// Increase Time
if(action == "up" && value + step > max){
var add = 1;
element.value = value - (max+1);
} else if(action == "down" && value - step < 0){
var add = -1;
element.value = (max+1) + value;
// Leading Zero
if(input.value < 10){
input.value = "0" + input.value;
}
if(add && this.con.timeIncrement && element.parentElement.previousElementSibling){
var next = element.parentElement.previousElementSibling.querySelector("input");
if(next.disabled === false){
next.value = parseInt(next.value) + add;
return this.handleTime({}, next);
// Increment
if(inc){
var prev = input.parentElement.previousElementSibling.querySelector("input");
if(prev && prev.disabled === false){
this.handleStep(prev, action, true);
}

@@ -791,4 +943,20 @@ }

// Set Time
var time = element.parentElement.parentElement.querySelectorAll("input");
this.selectTime(time[0].value, time[1].value, time[2].value);
if(typeof prevent !== "undefined" && prevent === true){
return false;
}
var time = input.parentElement.parentElement;
this.selectTime(
parseInt((time.querySelector("input[data-input=hours]") || {value: 0}).value) + (this.ampm? 12: 0),
parseInt((time.querySelector("input[data-input=minutes]") || {value: 0}).value),
parseInt((time.querySelector("input[data-input=seconds]") || {value: 0}).value)
);
// Check AM/PM
if(this.con.time12h){
var ampm = input.parentElement.parentElement.querySelector("input[type=checkbox]");
if(ampm && ampm.checked !== this.view.date.getHours() > 12){
ampm.checked = this.view.date.getHours() > 12;
}
}
return true;
},

@@ -804,13 +972,22 @@

case "days":
text = this.__["months"][this.view.date.getMonth()] + ", " + this.view.date.getFullYear(); break;
text = this.__["months"][this.view.date.getMonth()] + ", " + this.view.date.getFullYear();
break;
case "months":
text = this.view.date.getFullYear(); break;
text = this.view.date.getFullYear();
break;
case "years":
year = parseInt((this.view.date.getFullYear()).toString().slice(0, 3) + "0");
text = year + " - " + (year+10); break;
text = year + " - " + (year+10);
break;
case "decades":
year = parseInt((this.view.date.getFullYear()).toString().slice(0, 2) + "00");
text = year + " - " + (year+100); break;
text = year + " - " + (year+100);
break;
case "time":
text = this.__.header[3];
break;
}

@@ -1180,3 +1357,3 @@ label.innerText = text;

| PUBLIC :: OPEN CALENDAR
| @since 0.4.0 [0.1.0]
| @since 0.4.13 [0.1.0]
*/

@@ -1190,8 +1367,13 @@ open: function(){

// Animate
e.opacity = this.con.animate? 0: 1; e.display = "block";
cADD(cREM(this.dt, "calendar-close"), "calender-idle");
cHAS(this.dt, "calendar-static")? null: this.calcPosition();
e.display = "block";
e.opacity = (this.con.animate)? 0: 1;
cREM(this.dt, "calendar-close");
cADD(this.dt, "calendar-idle");
if(!cHAS(this.dt, "calendar-static")){
self.calcPosition();
}
(function fade(){
if((e.opacity = parseFloat(e.opacity)+0.125) >= 1){
cADD(cREM(self.dt, "calendar-idle"), "calendar-open");
cREM(self.dt, "calendar-idle");
cADD(self.dt, "calendar-open");
return self.trigger("open");

@@ -1206,3 +1388,3 @@ }

| PUBLIC :: CLOSE CALENDAR
| @since 0.4.0 [0.1.0]
| @since 0.4.13 [0.1.0]
*/

@@ -1216,7 +1398,10 @@ close: function(){

// Animate
cADD(cREM(this.dt, "calendar-open"), "calender-idle");
e.opacity = this.con.animate? 1: 0; e.display = "block";
e.display = "block";
e.opacity = (this.con.animate)? 1: 0;
cREM(this.dt, "calendar-open");
cADD(this.dt, "calendar-idle");
(function fade(){
if((e.opacity -= 0.125) <= 0){
cADD(cREM(self.dt, "calendar-idle"), "calendar-close");
cREM(self.dt, "calendar-idle");
cADD(self.dt, "calendar-close");
e.display = "none";

@@ -1305,3 +1490,3 @@ return self.trigger("close");

}
}
};

@@ -1308,0 +1493,0 @@ // Return

@@ -1,2 +0,2 @@

/* pytesNET/tail.DateTime v.0.4.12 | Full Version | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(t):(void 0===t.tail&&(t.tail={}),t.tail.DateTime=t.tail.datetime=e(t),"undefined"!=typeof jQuery&&(jQuery.fn.DateTime=jQuery.fn.datetime=function(t){var e,i=[];return this.each(function(){!1!==(e=tail.DateTime(this,t))&&i.push(e)}),1===i.length?i[0]:0!==i.length&&i}),"undefined"!=typeof MooTools&&(Element.implement({DateTime:function(t){return new tail.DateTime(this,t)}}),Element.implement({datetime:function(t){return new tail.DateTime(this,t)}})))}(this,function(t){"use strict";var o=t,c=t.document;function d(t,e){return!!t.classList&&t.classList.contains(e)}function a(t,e){return!!t.classList&&(t.classList.add(e),t)}function n(t,e){return!!t.classList&&(t.classList.remove(e),t)}function s(t,e,i){if(CustomEvent&&CustomEvent.name)var a=new CustomEvent(e,i);else(a=c.createEvent("CustomEvent")).initCustomEvent(e,!!i.bubbles,!!i.cancelable,i.detail);return t.dispatchEvent(a)}function h(t,e){return Object.assign({},t,e||{})}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}function u(t,e,i){var a=t instanceof Date?t:!!t&&new Date(t);return a instanceof Date&&!isNaN(a.getDate())&&(i&&a.setHours(0,0,0,0),!0===e?a.getTime():a)}var p=function(t,e){if((t="string"==typeof t?c.querySelectorAll(t):t)instanceof NodeList||t instanceof HTMLCollection||t instanceof Array){for(var i=[],a=t.length,n=0;n<a;n++)i.push(new p(t[n],e));return 1===i.length?i[0]:0!==i.length&&i}if(!(t instanceof Element))return!1;if(!(this instanceof p))return new p(t,e);if(p.inst[t.getAttribute("data-tail-datetime")])return p.inst[t.getAttribute("data-tail-datetime")];if(t.getAttribute("data-datetime")){var s=JSON.parse(t.getAttribute("data-datetime").replace(/\'/g,'"'));s instanceof Object&&(e=h(e,s))}return this.e=t,this.id=++p.count,this.con=h(p.defaults,e),(p.inst["tail-"+this.id]=this).init()};return p.version="0.4.12",p.status="beta",p.count=0,p.inst={},p.defaults={animate:!0,classNames:!1,closeButton:!0,dateFormat:"YYYY-mm-dd",dateStart:!1,dateRanges:[],dateBlacklist:!0,dateEnd:!1,locale:"en",position:"bottom",rtl:"auto",startOpen:!1,stayOpen:!1,timeFormat:"HH:ii:ss",timeHours:null,timeMinutes:null,timeSeconds:0,timeIncrement:!0,timeStepHours:1,timeStepMinutes:5,timeStepSeconds:5,today:!0,tooltips:[],viewDefault:"days",viewDecades:!0,viewYears:!0,viewMonths:!0,viewDays:!0,weekStart:0},p.strings={ar:{months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],days:["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],shorts:["أحد","إثن","ثلا","أرب","خمي","جمع","سبت"],time:["ساعة","دقيقة","ثانية"],header:["إختر الشهر","إخنر السنة","إختر العقد","إختر الوقت"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]},de_AT:{months:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorts:["SUN","MON","TUE","WED","THU","FRI","SAT"],time:["Hours","Minutes","Seconds"],header:["Select a Month","Select a Year","Select a Decade","Select a Time"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DOM","LUN","MAR","MIÉ","JUE","VIE","SÁB"],time:["Horas","Minutos","Segundos"],header:["Selecciona un mes","Seleccione un año","Seleccione un década","Seleccione una hora"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],days:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],shorts:["Su","Ma","Ti","Ke","To","Pe","La"],time:["Tunnit","Minuutit","Sekuntit"],header:["Valitse kuukausi","Valitse vuosi","Valitse vuosikymmen","Valitse aika"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shorts:["DIM","LUN","MAR","MER","JEU","VEN","SAM"],time:["Heure","Minute","Seconde"],header:["Choisissez un mois","Choisissez une année","Choisissez une décénie","Kies een Tijdstip"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shorts:["DOM","LUN","MAR","MER","GIO","VEN","SAB"],time:["Ore","Minuti","Secondi"],header:["Seleziona un mese","Seleziona un anno","Seleziona un decennio","Seleziona un orario"]},nl:{months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],shorts:["ZO","MA","DI","WO","DO","VR","ZA"],time:["Uur","Minuten","Seconden"],header:["Kies een Maand","Kies een Jaar","Kies een Decennium","Kies een Tijdstip"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],shorts:["SØN","MAN","TIR","ONS","TOR","FRE","LØR"],time:["Timer","Minutter","Sekunder"],header:["Velg måned","Velg år","Velg tiår","Velg klokkeslett"]},pt_BR:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shorts:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],time:["Horas","Minutos","Segundos"],header:["Escolha um mês","Escolha um ano","Escolha uma década","Escolha um horário"]},ru:{months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shorts:["вс","пн","вт","ср","чт","пт","сб"],time:["часов","минут","секунд"],header:["Выберите месяц","Выберите год","Выберите Десятилетие","Выберите время"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shorts:["PA","PT","SA","ÇA","PE","CU","CT"],time:["Saat","Dakika","Saniye"],header:["Ay Seçin","Yıl Seçin","On Yıl Seçin","Zaman Seçin"]},modify:function(t,e,i){if(!(t in this))return!1;if(e instanceof Object)for(var a in e)this.modify(t,a,e[a]);else this[t][e]="string"==typeof i?i:this[t][e];return!0},register:function(t,e){return"string"==typeof t&&e instanceof Object&&(this[t]=e,!0)}},p.prototype={init:function(){var t,e=this;if(this.__=h(p.strings.en,p.strings[this.con.locale]||{}),this.con.dateStart=u(this.con.dateStart,!0,!0)||0,this.con.dateEnd=u(this.con.dateEnd,!0,!0)||9999999999999,this.con.viewDefault=this.con.dateFormat?this.con.viewDefault:"time","string"==typeof this.con.weekStart&&(this.con.weekStart=p.strings.en.shorts.indexOf(this.con.weekStart)),this.con.weekStart<0&&6<this.con.weekStart&&(this.con.weekStart=0),0<this.con.dateRanges.length){for(var i=[],a=(l=this.con.dateRanges).length,n=0;n<a;n++)l[n]instanceof Object&&(l[n].start||l[n].days)&&(!1===(l[n].start=u(l[n].start||!1,!0,!0))?l[n].start=l[n].end=1/0:(!1===(l[n].end=u(l[n].end||!1,!0,!0))&&(l[n].end=l[n].start),l[n].start=l[n].start>l[n].end?[l[n].end,l[n].end=l[n].start][0]:l[n].start),l[n].days=!("days"in l[n])||l[n].days,l[n].days="boolean"!=typeof l[n].days?function(t){for(var e=[],i=t.length,a=0;a<i;a++)"string"==typeof t[a]&&(t[a]=p.strings.en.shorts.indexOf(t[a])),0<=t[a]&&t[a]<=6&&e.push(t[a]);return e}(l[n].days instanceof Array?l[n].days:[l[n].days]):[0,1,2,3,4,5,6],i.push({start:l[n].start,end:l[n].end,days:l[n].days}));this.con.dateRanges=i}if(0<this.con.tooltips.length){i=[];var s,r=this.con.tooltips;for(a=r.length,n=0;n<a;n++)r[n]instanceof Object&&r[n].date&&(r[n].date instanceof Array?(s=u(r[n].date[0]||!1,!0,!0),l=u(r[n].date[1]||!1,!0,!0)||s):s=l=u(r[n].date||!1,!0,!0),s&&i.push({date:s!==l?[s,l]:s,text:r[n].text||"Tooltip",color:r[n].color||"inherit",element:r[n].element||(t=c.createElement("DIV"),t.className="calendar-tooltip",t.innerHTML='<div class="tooltip-inner">'+r[n].text||"Tooltip</div>",t)}));this.con.tooltips=i}var o=this.__.shorts.slice(this.con.weekStart).concat(this.__.shorts.slice(0,this.con.weekStart));this.weekdays="<thead>\n<tr>\n";for(n=0;n<7;n++)this.weekdays+='<th class="calendar-week">'+o[n]+"</th>";this.weekdays+="\n</tr>\n</thead>",this.select=u(this.e.getAttribute("data-value")||this.e.value),(!this.select||this.select<this.con.dateStart||this.select>this.con.dateEnd)&&(this.select=null),null==this.view&&(this.view={type:this.con.viewDefault,date:this.select||new Date});for(a=["Hours","Minutes","Seconds"],n=0;n<3;n++)"number"==typeof this.con["time"+a[n]]&&this.view.date["set"+a[n]](this.con["time"+a[n]]);if(this.events={},this.dt=this.renderCalendar(),null==this._bind){var l="addEventListener";this.e[l]("focusin",function(t){e.open.call(e)}),this.e[l]("keyup",function(t){e.bind.call(e,t)}),c[l]("keyup",function(t){e.dt.contains(t.target)&&e.bind.call(e,t)}),c[l]("click",function(t){e.dt.contains(t.target)?e.bind.call(e,t):!e.e.contains(t.target)&&d(e.dt,"calendar-open")&&(t.target==e.dt||t.target==e.e||e.con.stayOpen||e.close.call(e))}),c[l]("mouseover",function(t){e.dt.contains(t.target)&&e.bind.call(e,t)}),this._bind=!0}return this.e.setAttribute("data-tail-datetime","tail-"+this.id),this.con.startOpen&&this.open(),this.select&&this.selectDate(this.select),this},bind:function(t){var e,i=t.target,a="getAttribute",n="data-action",s=i[a](n)?i:i.parentElement[a](n)?i.parentElement:i,r="data-tooltip";if("mouseover"==t.type&&(!1!==(e=i[a](r)?i:!!s[a](r)&&s)?this.dt.querySelector("#tooltip-"+e[a](r)+"-"+e[a](r+"-time"))||this.showTooltip(e[a](r),e,e[a](r+"-time")):this.dt.querySelector(".calendar-tooltip:not(.remove)")&&this.hideTooltip(this.dt.querySelector(".calendar-tooltip").id.slice(8))),"click"==t.type){if(!s||1!=t.buttons&&1!=(t.which||t.button))return;if(s.hasAttribute("data-disabled"))return;switch(s[a](n)){case"prev":case"next":return this.browseView(s[a](n));case"cancel":this.con.stayOpen||this.close();break;case"submit":return this.con.stayOpen||this.close(),this.selectDate(this.fetchDate(parseInt(s[a]("data-date"))));case"view":return this.switchDate(s[a]("data-year")||null,s[a]("data-month")||null,s[a]("data-day")||null),this.switchView(s[a]("data-view"))}}if("keyup"==t.type){if("INPUT"!=t.target.tagName&&t.target!==this.e&&/calendar-(static|close)/i.test(this.dt.className))return!1;13==(t.keyCode||t.which)&&(this.selectDate(this.fetchDate(this.select)),t.stopPropagation(),this.con.stayOpen||this.close()),27==(t.keyCode||t.which)&&(this.con.stayOpen||this.close())}},trigger:function(t){var e={bubbles:!1,cancelable:!0,detail:{args:arguments,self:this}};"change"==t&&(s(this.e,"input",e),s(this.e,"change",e)),s(this.dt,"tail::"+t,e);for(var i=(this.events[t]||[]).length,a=0;a<i;a++)this.events[t][a].cb.apply(this,function(t,e,i){for(var a=e.length,n=0;n<a;++n)t[n-1]=e[n];return t[n]=i,t}(new Array(arguments.length),arguments,this.events[t][a].args));return!0},calcPosition:function(){var t=this.dt.style,e=o.getComputedStyle(this.dt),i=parseInt(e.marginLeft)+parseInt(e.marginRight),a=parseInt(e.marginTop)+parseInt(e.marginBottom),n=function(t,e){for(e={top:t.offsetTop||0,left:t.offsetLeft||0,width:t.offsetWidth||0,height:t.offsetHeight||0};t=t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft;return e}(this.e,{});switch(t.visibility="hidden",this.con.position){case"top":var s=n.top-(this.dt.offsetHeight+a),r=n.left+n.width/2-(this.dt.offsetWidth/2+i/2);break;case"left":s=n.top+n.height/2-(this.dt.offsetHeight/2+a),r=n.left-(this.dt.offsetWidth+i);break;case"right":s=n.top+n.height/2-(this.dt.offsetHeight/2+a),r=n.left+n.width;break;default:s=n.top+n.height,r=n.left+n.width/2-(this.dt.offsetWidth/2+i/2)}return t.top=(0<=s?s:this.e.offsetTop)+"px",t.left=(0<=r?r:0)+"px",t.visibility="visible",this},convertDate:function(t,e){var i,a={H:String("00"+t.getHours()).toString().slice(-2),G:(i=t.getHours(),i%12?i%12:12),A:12<=t.getHours()?"PM":"AM",a:12<=t.getHours()?"pm":"am",i:String("00"+t.getMinutes()).toString().slice(-2),s:String("00"+t.getSeconds()).toString().slice(-2),Y:t.getFullYear(),y:parseInt(t.getFullYear().toString().slice(2)),m:String("00"+(t.getMonth()+1)).toString().slice(-2),M:this.__.months[t.getMonth()].slice(0,3),F:this.__.months[t.getMonth()],d:String("00"+t.getDate()).toString().slice(-2),D:this.__.days[t.getDay()],l:this.__.shorts[t.getDay()].toLowerCase()};return e.replace(/([HGismd]{1,2}|[Y]{2,4}|y{2})/g,function(t){return 4==t.length||2==t.length?a[t.slice(-1)].toString().slice(-Math.abs(t.length)):1==t.length&&"0"==t[0]?a[t.slice(-1)].toString().slice(-1):a[t.slice(-1)].toString()}).replace(/(A|a|M|F|D|l)/g,function(t){return a[t]})},renderCalendar:function(){var t,e=["tail-datetime-calendar","calendar-close"],i=c.createElement("DIV"),a=!0===this.con.classNames?this.e.className:this.con.classNames;["top","left","right","bottom"].indexOf(this.con.position)<0&&(t=c.querySelector(this.con.position),e.push("calendar-static")),("string"==typeof a||a instanceof Array)&&(e=e.concat("string"==typeof a?a.split(" "):a));var n=this.con.rtl;if((!0===n||"auto"===n&&0<=["ar","he","mdr","sam","syr"].indexOf(this.con.locale))&&e.push("rtl"),this.con.stayOpen&&e.push("calendar-stay"),i.id="tail-datetime-"+this.id,i.className=e.join(" "),i.style.cssText=this.con.rtl?"direction:rtl;":"direction:ltr;",this.con.dateFormat)var s='<span class="action action-prev" data-action="prev"></span><span class="label" data-action="view" data-view="up"></span><span class="action action-next" data-action="next"></span>';else if(this.con.timeFormat)s='<span class="action action-submit" data-action="submit"></span><span class="label"></span><span class="action action-cancel" data-action="cancel"></span>';if(void 0!==s&&(i.innerHTML='<div class="calendar-actions">'+s+"</div>"),this.con.dateFormat&&this.renderDatePicker(i,this.con.viewDefault),this.con.timeFormat&&this.renderTimePicker(i),this.con.closeButton&&!t){var r=c.createElement("BUTTON"),o=this;r.className="calendar-close",r.addEventListener("click",function(t){t.preventDefault(),o.close()}),i.appendChild(r)}return i.style.cssText=t?"position:static;visibility:visible;":"top:0;left:0;z-index:999;position:absolute;visibility:hidden;",(t||document.body).appendChild(i),i},renderDatePicker:function(t,e){if((!e||["decades","years","months","days"].indexOf(e)<0)&&(e=this.con.viewDays?"days":this.con.viewMonths?"months":this.con.viewYears?"years":!!this.con.viewDecades&&"decades"),!e||!this.con["view"+r(e)]||!this.con.dateFormat)return!1;var i=c.createElement("DIV");return i.className="calendar-datepicker calendar-view-"+e,i.innerHTML=this["view"+r(e)](),t.querySelector(".calendar-datepicker")?t.replaceChild(i,t.querySelector(".calendar-datepicker")):t.appendChild(i),this.view.type=e,this.handleLabel(t)},renderTimePicker:function(t){if(!this.con.timeFormat)return!1;var e=this.con.timeStepHours,i=this.con.timeStepMinutes,a=this.con.timeStepSeconds;e='<div class="timepicker-field timepicker-hours"><input type="number" name="dt[h]" value="" min="00" max="23" step="'+e+'" /><label>'+this.__.time[0]+"</label></div>",i='<div class="timepicker-field timepicker-minutes"><input type="number" name="dt[m]" value="" min="00" max="59" step="'+i+'" /><label>'+this.__.time[1]+"</label></div>",a='<div class="timepicker-field timepicker-seconds"><input type="number" name="dt[s]" value="" min="00" max="59" step="'+a+'" /><label>'+this.__.time[2]+"</label></div>";var n=c.createElement("DIV");n.className="calendar-timepicker",n.innerHTML=e+i+a;for(var s=this,r=n.querySelectorAll("input"),o=["Hours","Minutes","Seconds"],l=0;l<3;l++)r[l].value=this.view.date["get"+o[l]](),r[l].disabled=!1===this.con["time"+o[l]],r[l].addEventListener("input",function(t){s.handleTime.call(s,t,this)}),r[l].addEventListener("keydown",function(t){s.handleTime.call(s,t,this)});return t.querySelector(".calendar-timepicker")?t.replaceChild(n,t.querySelector(".calendar-timepicker")):t.appendChild(n),this.handleLabel(t)},handleTime:function(t,e){var i=parseInt(e.getAttribute("min")),a=parseInt(e.getAttribute("max")),n=parseInt(e.getAttribute("step")),s=parseInt(e.value),r="none";if(38==(t.keyCode||t.which)||a<s)r="up";if(40==(t.keyCode||t.which)||s<i)r="down";if("up"==r&&a<s+n){var o=1;e.value=s-(a+1)}else if("down"==r&&s-n<0){o=-1;e.value=a+1+s}if(o&&this.con.timeIncrement&&e.parentElement.previousElementSibling){var l=e.parentElement.previousElementSibling.querySelector("input");if(!1===l.disabled)return l.value=parseInt(l.value)+o,this.handleTime({},l)}var c=e.parentElement.parentElement.querySelectorAll("input");this.selectTime(c[0].value,c[1].value,c[2].value)},handleLabel:function(t){var e,i,a=t.querySelector(".label");switch(this.view.type){case"days":e=this.__.months[this.view.date.getMonth()]+", "+this.view.date.getFullYear();break;case"months":e=this.view.date.getFullYear();break;case"years":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,3)+"0"))+" - "+(i+10);break;case"decades":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,2)+"00"))+" - "+(i+100);break;case"time":e=this.__.header[3]}return a.innerText=e,t},viewDecades:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-30);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-decade"+(i>=e.getYear()&&i<=e.getYear()+10?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+" - "+(e.getFullYear()+10)+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+10);return'<table class="calendar-decades"><thead><tr><th colspan="4">'+this.__.header[2]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewYears:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-2);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-year"+(e.getYear()==i?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+1);return'<table class="calendar-years"><thead><tr><th colspan="4">'+this.__.header[1]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewMonths:function(){var t=this.__.months,e=this.con.today?(new Date).getMonth():-1;e=this.view.date.getYear()==(new Date).getYear()?e:-1;for(var i,a,n=[],s=[],r=0;r<12;r++)i="calendar-month"+(e==r?" date-today":""),a='data-action="view" data-view="down" data-month="'+r+'"',n.push('<td class="'+i+'" '+a+'><span class="inner">'+t[r]+"</span></td>"),3==n.length&&(s.push("<tr>\n"+n.join("\n")+"\n</tr>"),n=[]);return'<table class="calendar-months"><thead><tr><th colspan="3">'+this.__.header[0]+"</th></tr></thead><tbody>"+s.join("\n")+"</tbody></table>"},viewDays:function(){var i,t,e,a,n,s=new Date(this.view.date.getTime()),r=(new Date).toDateString(),o=s.getMonth(),l=[],c=[],d=[0,[]],h=[].concat(this.con.dateRanges),u=([].concat(this.con.tooltips),[0,0]);for(s.setHours(0,0,0,0),s.setDate(1),s.setDate(1-(s.getDay()-this.con.weekStart));c.length<6;)i=s.getTime(),e='data-action="submit" data-date="'+s.getTime()+'"',t="calendar-day date-"+(s.getMonth()>o?"next":s.getMonth()<o?"previous":"current"),this.con.today&&r==s.toDateString()&&(t+=" date-today"),this.con.dateBlacklist&&(i<this.con.dateStart||i>this.con.dateEnd)?d=[i<this.con.dateStart?this.con.dateStart:1/0,[0,1,2,3,4,5,6],!0]:0==d[0]?h=h.filter(function(t){return t.start==1/0||i>=t.start&&i<=t.end?!(d=[t.end,t.days]):t.start>i},this):3==d.length&&(d=[0,[0,1,2,3,4,5,6]]),0<this.con.tooltips.length&&this.con.tooltips.filter(function(t,e){t.date instanceof Array?t.date[0]<=i&&t.date[1]>=i&&(u=[t.date[1],e,t.color]):t.date==i&&(u=[t.date,e,t.color])},this),u[0]<i&&(u=[0,0]),(n=d[0]>=i&&0<=d[1].indexOf(s.getDay()))&&this.con.dateBlacklist||!n&&!this.con.dateBlacklist?(t+=" date-disabled",e+=' data-disabled="true"'):0!==d[0]&&d[0]<=i&&(d=[0,[]]),this.select&&this.select.toDateString()==s.toDateString()&&(t+=" date-select"),a='<span class="inner">'+s.getDate()+"</span>",0<u[0]&&(t+=" date-tooltip",e+=' data-tooltip="'+u[1]+'" data-tooltip-time="'+i+'"',"inherit"!==u[2]?a+='<span class="tooltip-tick" style="background:'+u[2]+';"></span>':a+='<span class="tooltip-tick"></span>'),l.push('<td class="'+t+'" '+e+">"+a+"</td>"),7==l.length&&(c.push("<tr>\n"+l.join("\n")+"\n</tr>"),l=[]),s.setDate(s.getDate()+1);return c="<tbody>"+c.join("\n")+"</tbody>",'<table class="calendar-days">'+this.weekdays+c+"</table>"},showTooltip:function(t,e,i){var a,n=this.con.tooltips[t].element,s=n.style,r=this.dt.querySelector(".calendar-datepicker");s.cssText="opacity:0;visibility:hidden;",n.id="tooltip-"+t+"-"+i,r.appendChild(n),a=n.offsetWidth,n.offsetHeight,s.top=e.offsetTop+e.offsetHeight+"px",s.left=e.offsetLeft+e.offsetWidth/2-a/2+"px",s.visibility="visible",this.con.animate?(n.setAttribute("data-top",parseInt(s.top)),s.top=parseInt(s.top)+5+"px",function t(){parseFloat(s.top)>n.getAttribute("data-top")&&(s.top=parseFloat(s.top)-.5+"px"),(s.opacity=parseFloat(s.opacity)+.125)<1&&setTimeout(t,20)}()):s.opacity=1},hideTooltip:function(t){var e=this.dt.querySelector("#tooltip-"+t),i=e.style;this.con.animate?(e.className+=" remove",function t(){if(parseFloat(i.top)<parseInt(e.getAttribute("data-top"))+5&&(i.top=parseFloat(i.top)+.5+"px"),(i.opacity-=.125)<0)return(e.className="calendar-tooltip")?e.parentElement.removeChild(e):"";setTimeout(t,20)}()):e.parentElement.removeChild(e)},switchView:function(t){var e=[null,"days","months","years","decades",null];return-1==e.indexOf(t)&&("up"==t?t=e[(e.indexOf(this.view.type)||5)+1]||null:"down"==t&&(t=e[(e.indexOf(this.view.type)||1)-1]||null),t&&this.con["view"+r(t)]||(t=!1)),!!t&&(this.renderDatePicker(this.dt,t),this.trigger("view",t))},switchDate:function(t,e,i,a){if(this.view.date.setFullYear(null==t?this.view.date.getFullYear():t),this.view.date.setMonth(null==e?this.view.date.getMonth():e),"auto"==i){var n=this.view.date,s=new Date;i=n.getMonth()==s.getMonth()&&n.getYear()==s.getYear()?s.getDate():1}return this.view.date.setDate(i||this.view.date.getDate()),!0===a||this.switchView(this.view.type)},switchMonth:function(t,e){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getMonth()+type),this.switchDate(e||this.getFullYear(),t)},switchYear:function(t){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getFullYear()+type),this.switchDate(t)},browseView:function(t){switch(t=0<=["previous","prev"].indexOf(t)?-1:1,this.view.type){case"days":return this.switchDate(null,this.view.date.getMonth()+t,"auto");case"months":return this.switchDate(this.view.date.getFullYear()+t,null,"auto");case"years":return this.switchDate(this.view.date.getFullYear()+10*t,null,"auto");case"decades":return this.switchDate(this.view.date.getFullYear()+100*t,null,"auto")}return!1},fetchDate:function(t){t=u(t||!1)||this.view.date;var e=this.dt.querySelectorAll("input[type=number]");return e&&3==e.length&&t.setHours(e[0].value||0,e[1].value||0,e[2].value||0,0),t},selectDate:function(t,e,i,a,n,s){var r=new Date,o=[];return this.con.dateFormat&&o.push(this.con.dateFormat),this.con.timeFormat&&o.push(this.con.timeFormat),this.select=t instanceof Date?t:new Date(t||(null==t?this.view.date.getFullYear():r.getFullYear()),e||(null==e?this.view.date.getMonth():r.getMonth()),i||(null==i?this.view.date.getDate():r.getDate()),a||(null==a?this.view.date.getHours():0),n||(null==n?this.view.date.getMinutes():0),s||(null==s?this.view.date.getSeconds():0)),this.view.date=new Date(this.select.getTime()),this.e.value=this.convertDate(this.select,o.join(" ")),this.e.setAttribute("data-value",this.select.getTime()),this.switchView("days"),this.trigger("change")},selectTime:function(t,e,i){return this.selectDate(void 0,void 0,void 0,t,e,i)},open:function(){if(!d(this.dt,"calendar-close"))return this;var e=this,i=this.dt.style;return i.opacity=this.con.animate?0:1,i.display="block",a(n(this.dt,"calendar-close"),"calender-idle"),!d(this.dt,"calendar-static")&&this.calcPosition(),function t(){if(1<=(i.opacity=parseFloat(i.opacity)+.125))return a(n(e.dt,"calendar-idle"),"calendar-open"),e.trigger("open");setTimeout(t,20)}(),this},close:function(){if(!d(this.dt,"calendar-open"))return this;var e=this,i=this.dt.style;return a(n(this.dt,"calendar-open"),"calender-idle"),i.opacity=this.con.animate?1:0,i.display="block",function t(){if((i.opacity-=.125)<=0)return a(n(e.dt,"calendar-idle"),"calendar-close"),i.display="none",e.trigger("close");setTimeout(t,20)}(),this},toggle:function(){return d(this.dt,"calendar-open")?this.close():d(this.dt,"calendar-close")?this.open():this},on:function(t,e,i){return!(["open","close","change","view"].indexOf(t)<0||"function"!=typeof e)&&(t in this.events||(this.events[t]=[]),this.events[t].push({cb:e,args:i instanceof Array?i:[]}),this)},remove:function(){return this.e.removeAttribute("data-tail-datetime"),this.e.removeAttribute("data-value"),this.dt.parentElement.removeChild(this.dt),this},reload:function(){return this.remove(),this.init()},config:function(t,e,i){if(t instanceof Object){for(var a in t)this.config(a,t[a],!1);return this.reload(),this.con}return void 0===t?this.con:t in this.con&&(void 0===e?this.con[t]:(this.con[t]=e,!1!==this.rebuild&&this.reload(),this))}},p});
/* pytesNET/tail.DateTime v.0.4.13 | Full Version | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t,t.document)}):"object"==typeof module&&module.exports?module.exports=e(t,t.document):(void 0===t.tail&&(t.tail={}),t.tail.DateTime=t.tail.datetime=e(t,t.document),"undefined"!=typeof jQuery&&(jQuery.fn.DateTime=jQuery.fn.datetime=function(t){var e,i=[];return this.each(function(){!1!==(e=tail.DateTime(this,t))&&i.push(e)}),1===i.length?i[0]:0!==i.length&&i}),"undefined"!=typeof MooTools&&(Element.implement({DateTime:function(t){return new tail.DateTime(this,t)}}),Element.implement({datetime:function(t){return new tail.DateTime(this,t)}})))}(window,function(d,h){"use strict";function u(t,e){return!!(t&&"classList"in t)&&t.classList.contains(e)}function a(t,e){return t&&"classList"in t?t.classList.add(e):void 0}function n(t,e){return t&&"classList"in t?t.classList.remove(e):void 0}function s(t,e,i){if(CustomEvent&&CustomEvent.name)var a=new CustomEvent(e,i);else(a=h.createEvent("CustomEvent")).initCustomEvent(e,!!i.bubbles,!!i.cancelable,i.detail);return t.dispatchEvent(a)}function o(t,e){if("function"==typeof Object.assign)return Object.assign({},t,e||{});var i=Object.constructor();for(var a in t)i[a]=a in e?e[a]:t[a];return i}function p(t,e){var i=h.createElement(t);return i.className=e&&e.join?e.join(" "):e||"",i}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,i){var a=t instanceof Date?t:!!t&&new Date(t);return a instanceof Date&&!isNaN(a.getDate())&&(i&&a.setHours(0,0,0,0),!0===e?a.getTime():a)}h.forms.inputmode=!0;var c=function(t,e){if((t="string"==typeof t?h.querySelectorAll(t):t)instanceof NodeList||t instanceof HTMLCollection||t instanceof Array){for(var i=[],a=t.length,n=0;n<a;n++)i.push(new c(t[n],e));return 1===i.length?i[0]:0!==i.length&&i}if(!(t instanceof Element))return!1;if(!(this instanceof c))return new c(t,e);if(c.inst[t.getAttribute("data-tail-datetime")])return c.inst[t.getAttribute("data-tail-datetime")];if(t.getAttribute("data-datetime")){var s=JSON.parse(t.getAttribute("data-datetime").replace(/\'/g,'"'));s instanceof Object&&(e=o(e,s))}return this.e=t,this.id=++c.count,this.con=o(c.defaults,e),(c.inst["tail-"+this.id]=this).e.setAttribute("data-tail-datetime","tail-"+this.id),this.init()};return c.version="0.4.13",c.status="beta",c.count=0,c.inst={},c.defaults={animate:!0,classNames:!1,closeButton:!0,dateFormat:"YYYY-mm-dd",dateStart:!1,dateRanges:[],dateBlacklist:!0,dateEnd:!1,locale:"en",position:"bottom",rtl:"auto",startOpen:!1,stayOpen:!1,time12h:!1,timeFormat:"HH:ii:ss",timeHours:!0,timeMinutes:!0,timeSeconds:0,timeIncrement:!0,timeStepHours:1,timeStepMinutes:5,timeStepSeconds:5,today:!0,tooltips:[],viewDefault:"days",viewDecades:!0,viewYears:!0,viewMonths:!0,viewDays:!0,weekStart:0},c.strings={ar:{months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],days:["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],shorts:["أحد","إثن","ثلا","أرب","خمي","جمع","سبت"],time:["ساعة","دقيقة","ثانية"],header:["إختر الشهر","إخنر السنة","إختر العقد","إختر الوقت"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],shorts:["NE","PO","ÚT","ST","ČT","PÁ","SO"],time:["Hodiny","Minuty","Sekundy"],header:["Vyberte měsíc","Vyberte rok","Vyberte desetiletí","Vyberte čas"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]},de_AT:{months:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],days:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],shorts:["ΚΥΡ","ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ"],time:["Ώρες","Λεπτά","Δευτερόλεπτα"],header:["Επιλογή Μηνός","Επιλογή Έτους","Επιλογή Δεκαετίας","Επιλογή Ώρας"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorts:["SUN","MON","TUE","WED","THU","FRI","SAT"],time:["Hours","Minutes","Seconds"],header:["Select a Month","Select a Year","Select a Decade","Select a Time"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DOM","LUN","MAR","MIÉ","JUE","VIE","SÁB"],time:["Horas","Minutos","Segundos"],header:["Selecciona un mes","Seleccione un año","Seleccione un década","Seleccione una hora"]},es_MX:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DO","LU","MA","MI","JU","VI","SÁ"],time:["Horas","Minutos","Segundos"],header:["Selecciona un Mes","Selecciona un Año","Selecciona una Decada","Selecciona la Hora"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],days:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],shorts:["Su","Ma","Ti","Ke","To","Pe","La"],time:["Tunnit","Minuutit","Sekuntit"],header:["Valitse kuukausi","Valitse vuosi","Valitse vuosikymmen","Valitse aika"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shorts:["DIM","LUN","MAR","MER","JEU","VEN","SAM"],time:["Heure","Minute","Seconde"],header:["Choisissez un mois","Choisissez une année","Choisissez une décénie","Kies een Tijdstip"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shorts:["DOM","LUN","MAR","MER","GIO","VEN","SAB"],time:["Ore","Minuti","Secondi"],header:["Seleziona un mese","Seleziona un anno","Seleziona un decennio","Seleziona un orario"]},nl:{months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],shorts:["ZO","MA","DI","WO","DO","VR","ZA"],time:["Uur","Minuten","Seconden"],header:["Kies een Maand","Kies een Jaar","Kies een Decennium","Kies een Tijdstip"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],shorts:["SØN","MAN","TIR","ONS","TOR","FRE","LØR"],time:["Timer","Minutter","Sekunder"],header:["Velg måned","Velg år","Velg tiår","Velg klokkeslett"]},pl:{months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],shorts:["ND","PN","WT","ŚR","CZW","PT","SOB"],time:["Godzina","Minuta","Sekunda"],header:["Wybierz miesiąc","Wybierz rok","Wybierz dekadę","Wybierz czas"]},pt_BR:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shorts:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],time:["Horas","Minutos","Segundos"],header:["Escolha um mês","Escolha um ano","Escolha uma década","Escolha um horário"]},ru:{months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shorts:["вс","пн","вт","ср","чт","пт","сб"],time:["часов","минут","секунд"],header:["Выберите месяц","Выберите год","Выберите Десятилетие","Выберите время"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shorts:["PA","PT","SA","ÇA","PE","CU","CT"],time:["Saat","Dakika","Saniye"],header:["Ay Seçin","Yıl Seçin","On Yıl Seçin","Zaman Seçin"]},modify:function(t,e,i){if(!(t in this))return!1;if(e instanceof Object)for(var a in e)this.modify(t,a,e[a]);else this[t][e]="string"==typeof i?i:this[t][e];return!0},register:function(t,e){return"string"==typeof t&&e instanceof Object&&(this[t]=e,!0)}},c.prototype={init:function(){this.prepare();var t=this.__.shorts.slice(this.con.weekStart).concat(this.__.shorts.slice(0,this.con.weekStart));this.weekdays="<thead>\n<tr>\n";for(var e=0;e<7;e++)this.weekdays+='<th class="calendar-week">'+t[e]+"</th>";this.weekdays+="\n</tr>\n</thead>",this.select=l(this.e.getAttribute("data-value")||this.e.value),(!this.select||this.select<this.con.dateStart||this.select>this.con.dateEnd)&&(this.select=null),null==this.view&&(this.view={type:this.con.viewDefault,date:this.select||new Date});var i=["Hours","Minutes","Seconds"];for(e=0;e<3;e++)if("number"==typeof this.con["time"+i[e]])this.view.date["set"+i[e]](this.con["time"+i[e]]);else for(;this.view.date["get"+i[e]]()%this.con["timeStep"+i[e]]!=0;)this.view.date["set"+i[e]](this.view.date["get"+i[e]]()+1);return this.ampm=12<this.view.date.getHours(),this.events={},this.dt=this.renderCalendar(),this.con.startOpen&&this.open(),this.select&&this.selectDate(this.select),this.bind()},prepare:function(){if(this.__=o(c.strings.en,c.strings[this.con.locale]||{}),this.con.dateStart=l(this.con.dateStart,!0,!0)||-9999999999999,this.con.dateEnd=l(this.con.dateEnd,!0,!0)||9999999999999,this.con.viewDefault=this.con.dateFormat?this.con.viewDefault:"time","string"==typeof this.con.weekStart&&(this.con.weekStart=c.strings.en.shorts.indexOf(this.con.weekStart)),this.con.weekStart<0&&6<this.con.weekStart&&(this.con.weekStart=0),0<this.con.dateRanges.length){for(var t=[],e=(n=this.con.dateRanges).length,i=0;i<e;i++)n[i]instanceof Object&&(n[i].start||n[i].days)&&(!1===(n[i].start=l(n[i].start||!1,!0,!0))?n[i].start=n[i].end=1/0:(!1===(n[i].end=l(n[i].end||!1,!0,!0))&&(n[i].end=n[i].start),n[i].start=n[i].start>n[i].end?[n[i].end,n[i].end=n[i].start][0]:n[i].start),n[i].days=!("days"in n[i])||n[i].days,n[i].days="boolean"!=typeof n[i].days?function(t){for(var e=[],i=t.length,a=0;a<i;a++)"string"==typeof t[a]&&(t[a]=c.strings.en.shorts.indexOf(t[a])),0<=t[a]&&t[a]<=6&&e.push(t[a]);return e}(n[i].days instanceof Array?n[i].days:[n[i].days]):[0,1,2,3,4,5,6],t.push({start:n[i].start,end:n[i].end,days:n[i].days}));this.con.dateRanges=t}if(0<this.con.tooltips.length){t=[];var a,n,s=this.con.tooltips;for(e=s.length,i=0;i<e;i++)s[i]instanceof Object&&s[i].date&&(s[i].date instanceof Array?(a=l(s[i].date[0]||!1,!0,!0),n=l(s[i].date[1]||!1,!0,!0)||a):a=n=l(s[i].date||!1,!0,!0),a&&t.push({date:a!==n?[a,n]:a,text:s[i].text||"Tooltip",color:s[i].color||"inherit",element:s[i].element||(r=h.createElement("DIV"),r.className="calendar-tooltip",r.innerHTML='<div class="tooltip-inner">'+s[i].text||"Tooltip</div>",r)}));this.con.tooltips=t}var r;return this},bind:function(){var e=this;return void 0===this._bind&&(this.e.addEventListener("focusin",function(t){e.open.call(e)}),this.e.addEventListener("keyup",function(t){e.callback.call(e,t)}),h.addEventListener("keyup",function(t){e.dt.contains(t.target)&&e.callback.call(e,t)}),h.addEventListener("click",function(t){e.dt.contains(t.target)?e.callback.call(e,t):!e.e.contains(t.target)&&u(e.dt,"calendar-open")&&(t.target==e.dt||t.target==e.e||e.con.stayOpen||e.close.call(e))}),h.addEventListener("mouseover",function(t){e.dt.contains(t.target)&&e.callback.call(e,t)}),this._bind=!0),this},callback:function(t){var e,i=t.target,a="getAttribute",n="data-action",s=i[a](n)?i:i.parentElement[a](n)?i.parentElement:i,r="data-tooltip";if("mouseover"==t.type&&(!1!==(e=i[a](r)?i:!!s[a](r)&&s)?this.dt.querySelector("#tooltip-"+e[a](r)+"-"+e[a](r+"-time"))||this.showTooltip(e[a](r),e,e[a](r+"-time")):this.dt.querySelector(".calendar-tooltip:not(.remove)")&&this.hideTooltip(this.dt.querySelector(".calendar-tooltip").id.slice(8))),"click"==t.type){if(!s||1!=t.buttons&&1!=(t.which||t.button))return;if(s.hasAttribute("data-disabled"))return;switch(s[a](n)){case"prev":case"next":return this.browseView(s[a](n));case"cancel":this.con.stayOpen||this.close();break;case"submit":return this.con.stayOpen||this.close(),this.selectDate(this.fetchDate(parseInt(s[a]("data-date"))));case"view":return this.switchDate(s[a]("data-year")||null,s[a]("data-month")||null,s[a]("data-day")||null),this.switchView(s[a]("data-view"))}}if("keyup"==t.type){if("INPUT"!=t.target.tagName&&t.target!==this.e&&/calendar-(static|close)/i.test(this.dt.className))return!1;13==(t.keyCode||t.which)&&(this.selectDate(this.fetchDate(this.select)),t.stopPropagation(),this.con.stayOpen||this.close()),27==(t.keyCode||t.which)&&(this.con.stayOpen||this.close())}},trigger:function(t){var e={bubbles:!1,cancelable:!0,detail:{args:arguments,self:this}};"change"==t&&(s(this.e,"input",e),s(this.e,"change",e)),s(this.dt,"tail::"+t,e);for(var i=(this.events[t]||[]).length,a=0;a<i;a++)this.events[t][a].cb.apply(this,function(t,e,i){for(var a=e.length,n=0;n<a;++n)t[n-1]=e[n];return t[n]=i,t}(new Array(arguments.length),arguments,this.events[t][a].args));return!0},calcPosition:function(){var t=this.dt.style,e=d.getComputedStyle(this.dt),i=parseInt(e.marginLeft)+parseInt(e.marginRight),a=parseInt(e.marginTop)+parseInt(e.marginBottom),n=this.e.getBoundingClientRect().top+d.scrollY,s=this.e.getBoundingClientRect().left-d.scrollX,r=this.e.offsetWidth||0,o=this.e.offsetHeight||0;switch(t.visibility="hidden",this.con.position){case"top":var l=n-(this.dt.offsetHeight+a),c=s+r/2-(this.dt.offsetWidth/2+i/2);break;case"left":l=n+o/2-(this.dt.offsetHeight/2+a),c=s-(this.dt.offsetWidth+i);break;case"right":l=n+o/2-(this.dt.offsetHeight/2+a),c=s+r;break;default:l=n+o,c=s+r/2-(this.dt.offsetWidth/2+i/2)}return t.top=(0<=l?l:this.e.offsetTop)+"px",t.left=(0<=c?c:0)+"px",t.visibility="visible",this},convertDate:function(t,e){var i,a={H:String("00"+t.getHours()).toString().slice(-2),G:(i=t.getHours(),i%12?i%12:12),A:12<=t.getHours()?"PM":"AM",a:12<=t.getHours()?"pm":"am",i:String("00"+t.getMinutes()).toString().slice(-2),s:String("00"+t.getSeconds()).toString().slice(-2),Y:t.getFullYear(),y:parseInt(t.getFullYear().toString().slice(2)),m:String("00"+(t.getMonth()+1)).toString().slice(-2),M:this.__.months[t.getMonth()].slice(0,3),F:this.__.months[t.getMonth()],d:String("00"+t.getDate()).toString().slice(-2),D:this.__.days[t.getDay()],l:this.__.shorts[t.getDay()].toLowerCase()};return e.replace(/([HGismd]{1,2}|[Y]{2,4}|y{2})/g,function(t){return 4==t.length||2==t.length?a[t.slice(-1)].toString().slice(-Math.abs(t.length)):1==t.length&&"0"==t[0]?a[t.slice(-1)].toString().slice(-1):a[t.slice(-1)].toString()}).replace(/(A|a|M|F|D|l)/g,function(t){return a[t]})},renderCalendar:function(){var t=["tail-datetime-calendar","calendar-close"],e=!0===this.con.classNames?this.e.className.split(" "):this.con.classNames;if(["top","left","right","bottom"].indexOf(this.con.position)<0){var i=h.querySelector(this.con.position);t.push("calendar-static")}(!0===this.con.rtl||0<=["ar","he","mdr","sam","syr"].indexOf(this.con.rtl))&&t.push("rtl"),this.con.stayOpen&&t.push("calendar-stay"),(e="function"==typeof e.split?e.split(" "):e)instanceof Array&&(t=t.concat(e));var a=p("DIV",t),n=!1;if(a.id="tail-datetime-"+this.id,this.con.dateFormat?n='<span class="action action-prev" data-action="prev"></span><span class="label" data-action="view" data-view="up"></span><span class="action action-next" data-action="next"></span>':this.con.timeFormat&&(n='<span class="action action-submit" data-action="submit"></span><span class="label"></span><span class="action action-cancel" data-action="cancel"></span>'),a.innerHTML=n?'<div class="calendar-actions">'+n+"</div>":"",this.con.dateFormat&&this.renderDatePicker(a,this.con.viewDefault),this.con.timeFormat&&this.renderTimePicker(a),this.con.closeButton&&!i){var s=p("BUTTON","calendar-close"),r=this;s.addEventListener("click",function(t){t.preventDefault(),r.close()}),a.appendChild(s)}return(i||h.body).appendChild(a),a},renderDatePicker:function(t,e){if((!e||["decades","years","months","days"].indexOf(e)<0)&&(e=this.con.viewDays?"days":this.con.viewMonths?"months":this.con.viewYears?"years":!!this.con.viewDecades&&"decades"),!e||!this.con["view"+m(e)]||!this.con.dateFormat)return!1;var i=h.createElement("DIV");return i.className="calendar-datepicker calendar-view-"+e,i.innerHTML=this["view"+m(e)](),t.querySelector(".calendar-datepicker")?t.replaceChild(i,t.querySelector(".calendar-datepicker")):t.appendChild(i),this.view.type=e,this.handleLabel(t)},renderTimePicker:function(t){if(!this.con.timeFormat)return!1;var e,i,a=[],n=0;if(this.con.time12h){var s=12<this.view.date.getHours()?'checked="checked" ':"";a.push('<label class="timepicker-switch" data-am="AM" data-pm="PM"><input type="checkbox" value="1" data-input="PM" '+s+"/><span></span></label>")}for(var r in{Hours:0,Minutes:0,Seconds:0})!1!==this.con["time"+r]?((e=h.createElement("INPUT")).type="text",e.disabled=null===this.con["time"+r],e.setAttribute("min","Hours"===r&&this.con.time12h?"01":"00"),e.setAttribute("max","Hours"!==r?"60":this.con.time12h?"13":"24"),e.setAttribute("step",this.con["timeStep"+r]),e.setAttribute("value",(i=this.view.date["get"+r]())<10?"0"+i:i),e.setAttribute("pattern","d*"),e.setAttribute("inputmode","numeric"),e.setAttribute("data-input",r.toLowerCase()),a.push('<div class="timepicker-field timepicker-'+r.toLowerCase()+'">'+e.outerHTML+'<button class="picker-step step-up"></button><button class="picker-step step-down"></button><label>'+this.__.time[n++]+"</label></div>")):a.push((n++,null));var o=p("DIV","calendar-timepicker"),l=this;o.innerHTML=a.join("\n");var c=o.querySelectorAll("input");for(n=0;n<c.length;n++)"checkbox"!==c[n].type?(c[n].addEventListener("input",function(t){l.handleTime.call(l,this)}),c[n].addEventListener("keydown",function(t){var e=event.keyCode||event.which||0;if(38===e||40===e)return t.preventDefault(),l.handleStep.call(l,this,38===e?"up":"down"),!1})):c[n].addEventListener("change",function(t){l.handleTime.call(l,this)});for(c=o.querySelectorAll("button"),n=0;n<c.length;n++)c[n].addEventListener("mousedown",function(t){t.preventDefault();var e=this.parentElement.querySelector("input");return l.handleStep.call(l,e,u(this,"step-up")?"up":"down"),!1});var d=t.querySelector(".calendar-timepicker");return t[d?"replaceChild":"appendChild"](o,d),this.handleLabel(t)},handleTime:function(t){this.con.time12h&&"checkbox"===t.type&&(this.ampm=t.checked);var e=t.parentElement.parentElement;e=[e.querySelector("input[data-input=hours]")||{value:0},e.querySelector("input[data-input=minutes]")||{value:0},e.querySelector("input[data-input=seconds]")||{value:0}],this.selectTime(parseInt(e[0].value)+(this.ampm?12:0),parseInt(e[1].value),parseInt(e[2].value)),e[2].value=this.view.date.getSeconds(),e[1].value=this.view.date.getMinutes(),this.con.time12h?e[0].value=12<this.view.date.getHours()?this.view.date.getHours()-12:this.view.date.getHours():e[0].value=this.view.date.getHours()},handleStep:function(t,e,i){var a=!1,n=t.getAttribute("data-input"),s=this.con["timeStep"+m(n)],r=parseInt(t.value),o="hours"!==n?60:this.con.time12h?13:24;if("up"===e&&o<=r+s?(a=this.con.timeIncrement&&60==o,t.value=13==o?1:0,this.ampm=12<=this.view.date.getHours()+1):"down"===e&&r-s<(13==o?1:0)?(a=this.con.timeIncrement&&60==o,t.value=o-s,this.ampm=this.view.date.getHours()-1<=0):t.value="up"===e?r+s:r-s,t.value<10&&(t.value="0"+t.value),a){var l=t.parentElement.previousElementSibling.querySelector("input");l&&!1===l.disabled&&this.handleStep(l,e,!0)}if(void 0!==i&&!0===i)return!1;var c=t.parentElement.parentElement;if(this.selectTime(parseInt((c.querySelector("input[data-input=hours]")||{value:0}).value)+(this.ampm?12:0),parseInt((c.querySelector("input[data-input=minutes]")||{value:0}).value),parseInt((c.querySelector("input[data-input=seconds]")||{value:0}).value)),this.con.time12h){var d=t.parentElement.parentElement.querySelector("input[type=checkbox]");d&&d.checked!==12<this.view.date.getHours()&&(d.checked=12<this.view.date.getHours())}return!0},handleLabel:function(t){var e,i,a=t.querySelector(".label");switch(this.view.type){case"days":e=this.__.months[this.view.date.getMonth()]+", "+this.view.date.getFullYear();break;case"months":e=this.view.date.getFullYear();break;case"years":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,3)+"0"))+" - "+(i+10);break;case"decades":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,2)+"00"))+" - "+(i+100);break;case"time":e=this.__.header[3]}return a.innerText=e,t},viewDecades:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-30);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-decade"+(i>=e.getYear()&&i<=e.getYear()+10?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+" - "+(e.getFullYear()+10)+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+10);return'<table class="calendar-decades"><thead><tr><th colspan="4">'+this.__.header[2]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewYears:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-2);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-year"+(e.getYear()==i?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+1);return'<table class="calendar-years"><thead><tr><th colspan="4">'+this.__.header[1]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewMonths:function(){var t=this.__.months,e=this.con.today?(new Date).getMonth():-1;e=this.view.date.getYear()==(new Date).getYear()?e:-1;for(var i,a,n=[],s=[],r=0;r<12;r++)i="calendar-month"+(e==r?" date-today":""),a='data-action="view" data-view="down" data-month="'+r+'"',n.push('<td class="'+i+'" '+a+'><span class="inner">'+t[r]+"</span></td>"),3==n.length&&(s.push("<tr>\n"+n.join("\n")+"\n</tr>"),n=[]);return'<table class="calendar-months"><thead><tr><th colspan="3">'+this.__.header[0]+"</th></tr></thead><tbody>"+s.join("\n")+"</tbody></table>"},viewDays:function(){var i,t,e,a,n,s=new Date(this.view.date.getTime()),r=(new Date).toDateString(),o=s.getMonth(),l=[],c=[],d=[0,[]],h=[].concat(this.con.dateRanges),u=([].concat(this.con.tooltips),[0,0]);for(s.setHours(0,0,0,0),s.setDate(1),s.setDate(1-(s.getDay()-this.con.weekStart));c.length<6;)i=s.getTime(),e='data-action="submit" data-date="'+s.getTime()+'"',t="calendar-day date-"+(s.getMonth()>o?"next":s.getMonth()<o?"previous":"current"),this.con.today&&r==s.toDateString()&&(t+=" date-today"),this.con.dateBlacklist&&(i<this.con.dateStart||i>this.con.dateEnd)?d=[i<this.con.dateStart?this.con.dateStart:1/0,[0,1,2,3,4,5,6],!0]:0==d[0]?h=h.filter(function(t){return t.start==1/0||i>=t.start&&i<=t.end?!(d=[t.end,t.days]):t.start>i},this):3==d.length&&(d=[0,[0,1,2,3,4,5,6]]),0<this.con.tooltips.length&&this.con.tooltips.filter(function(t,e){t.date instanceof Array?t.date[0]<=i&&t.date[1]>=i&&(u=[t.date[1],e,t.color]):t.date==i&&(u=[t.date,e,t.color])},this),u[0]<i&&(u=[0,0]),(n=d[0]>=i&&0<=d[1].indexOf(s.getDay()))&&this.con.dateBlacklist||!n&&!this.con.dateBlacklist?(t+=" date-disabled",e+=' data-disabled="true"'):0!==d[0]&&d[0]<=i&&(d=[0,[]]),this.select&&this.select.toDateString()==s.toDateString()&&(t+=" date-select"),a='<span class="inner">'+s.getDate()+"</span>",0<u[0]&&(t+=" date-tooltip",e+=' data-tooltip="'+u[1]+'" data-tooltip-time="'+i+'"',"inherit"!==u[2]?a+='<span class="tooltip-tick" style="background:'+u[2]+';"></span>':a+='<span class="tooltip-tick"></span>'),l.push('<td class="'+t+'" '+e+">"+a+"</td>"),7==l.length&&(c.push("<tr>\n"+l.join("\n")+"\n</tr>"),l=[]),s.setDate(s.getDate()+1);return c="<tbody>"+c.join("\n")+"</tbody>",'<table class="calendar-days">'+this.weekdays+c+"</table>"},showTooltip:function(t,e,i){var a,n=this.con.tooltips[t].element,s=n.style,r=this.dt.querySelector(".calendar-datepicker");s.cssText="opacity:0;visibility:hidden;",n.id="tooltip-"+t+"-"+i,r.appendChild(n),a=n.offsetWidth,n.offsetHeight,s.top=e.offsetTop+e.offsetHeight+"px",s.left=e.offsetLeft+e.offsetWidth/2-a/2+"px",s.visibility="visible",this.con.animate?(n.setAttribute("data-top",parseInt(s.top)),s.top=parseInt(s.top)+5+"px",function t(){parseFloat(s.top)>n.getAttribute("data-top")&&(s.top=parseFloat(s.top)-.5+"px"),(s.opacity=parseFloat(s.opacity)+.125)<1&&setTimeout(t,20)}()):s.opacity=1},hideTooltip:function(t){var e=this.dt.querySelector("#tooltip-"+t),i=e.style;this.con.animate?(e.className+=" remove",function t(){if(parseFloat(i.top)<parseInt(e.getAttribute("data-top"))+5&&(i.top=parseFloat(i.top)+.5+"px"),(i.opacity-=.125)<0)return(e.className="calendar-tooltip")?e.parentElement.removeChild(e):"";setTimeout(t,20)}()):e.parentElement.removeChild(e)},switchView:function(t){var e=[null,"days","months","years","decades",null];return-1==e.indexOf(t)&&("up"==t?t=e[(e.indexOf(this.view.type)||5)+1]||null:"down"==t&&(t=e[(e.indexOf(this.view.type)||1)-1]||null),t&&this.con["view"+m(t)]||(t=!1)),!!t&&(this.renderDatePicker(this.dt,t),this.trigger("view",t))},switchDate:function(t,e,i,a){if(this.view.date.setFullYear(null==t?this.view.date.getFullYear():t),this.view.date.setMonth(null==e?this.view.date.getMonth():e),"auto"==i){var n=this.view.date,s=new Date;i=n.getMonth()==s.getMonth()&&n.getYear()==s.getYear()?s.getDate():1}return this.view.date.setDate(i||this.view.date.getDate()),!0===a||this.switchView(this.view.type)},switchMonth:function(t,e){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getMonth()+type),this.switchDate(e||this.getFullYear(),t)},switchYear:function(t){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getFullYear()+type),this.switchDate(t)},browseView:function(t){switch(t=0<=["previous","prev"].indexOf(t)?-1:1,this.view.type){case"days":return this.switchDate(null,this.view.date.getMonth()+t,"auto");case"months":return this.switchDate(this.view.date.getFullYear()+t,null,"auto");case"years":return this.switchDate(this.view.date.getFullYear()+10*t,null,"auto");case"decades":return this.switchDate(this.view.date.getFullYear()+100*t,null,"auto")}return!1},fetchDate:function(t){t=l(t||!1)||this.view.date;var e=this.dt.querySelectorAll("input[type=number]");return e&&3==e.length&&t.setHours(e[0].value||0,e[1].value||0,e[2].value||0,0),t},selectDate:function(t,e,i,a,n,s){var r=new Date,o=[];return this.con.dateFormat&&o.push(this.con.dateFormat),this.con.timeFormat&&o.push(this.con.timeFormat),this.select=t instanceof Date?t:new Date(t||(null==t?this.view.date.getFullYear():r.getFullYear()),e||(null==e?this.view.date.getMonth():r.getMonth()),i||(null==i?this.view.date.getDate():r.getDate()),a||(null==a?this.view.date.getHours():0),n||(null==n?this.view.date.getMinutes():0),s||(null==s?this.view.date.getSeconds():0)),this.view.date=new Date(this.select.getTime()),this.e.value=this.convertDate(this.select,o.join(" ")),this.e.setAttribute("data-value",this.select.getTime()),this.switchView("days"),this.trigger("change")},selectTime:function(t,e,i){return this.selectDate(void 0,void 0,void 0,t,e,i)},open:function(){if(!u(this.dt,"calendar-close"))return this;var e=this,i=this.dt.style;return i.display="block",i.opacity=this.con.animate?0:1,n(this.dt,"calendar-close"),a(this.dt,"calendar-idle"),u(this.dt,"calendar-static")||e.calcPosition(),function t(){if(1<=(i.opacity=parseFloat(i.opacity)+.125))return n(e.dt,"calendar-idle"),a(e.dt,"calendar-open"),e.trigger("open");setTimeout(t,20)}(),this},close:function(){if(!u(this.dt,"calendar-open"))return this;var e=this,i=this.dt.style;return i.display="block",i.opacity=this.con.animate?1:0,n(this.dt,"calendar-open"),a(this.dt,"calendar-idle"),function t(){if((i.opacity-=.125)<=0)return n(e.dt,"calendar-idle"),a(e.dt,"calendar-close"),i.display="none",e.trigger("close");setTimeout(t,20)}(),this},toggle:function(){return u(this.dt,"calendar-open")?this.close():u(this.dt,"calendar-close")?this.open():this},on:function(t,e,i){return!(["open","close","change","view"].indexOf(t)<0||"function"!=typeof e)&&(t in this.events||(this.events[t]=[]),this.events[t].push({cb:e,args:i instanceof Array?i:[]}),this)},remove:function(){return this.e.removeAttribute("data-tail-datetime"),this.e.removeAttribute("data-value"),this.dt.parentElement.removeChild(this.dt),this},reload:function(){return this.remove(),this.init()},config:function(t,e,i){if(t instanceof Object){for(var a in t)this.config(a,t[a],!1);return this.reload(),this.con}return void 0===t?this.con:t in this.con&&(void 0===e?this.con[t]:(this.con[t]=e,!1!==this.rebuild&&this.reload(),this))}},c});
/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./js/tail.datetime.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -13,5 +13,5 @@ | @website https://github.com/pytesNET/tail.DateTime

if(typeof define === "function" && define.amd){
define(function(){ return factory(root); });
define(function(){ return factory(root, root.document); });
} else if(typeof module === "object" && module.exports){
module.exports = factory(root);
module.exports = factory(root, root.document);
} else {

@@ -21,3 +21,3 @@ if(typeof root.tail === "undefined"){

}
root.tail.DateTime = root.tail.datetime = factory(root);
root.tail.DateTime = root.tail.datetime = factory(root, root.document);

@@ -39,15 +39,15 @@ // jQuery Support

}
}(this, function(root){
}(window, function(w, d){
"use strict";
var w = root, d = root.document;
d.forms.inputmode = true;
// Internal Helper Methods
function cHAS(el, name){
return (!el.classList)? false: el.classList.contains(name);
return (el && "classList" in el)? el.classList.contains(name): false;
}
function cADD(el, name){
return (!el.classList)? false: (el.classList.add(name))? el: el;
return (el && "classList" in el)? el.classList.add(name): undefined;
}
function cREM(el, name){
return (!el.classList)? false: (el.classList.remove(name))? el: el;
return (el && "classList" in el)? el.classList.remove(name): undefined;
}

@@ -64,5 +64,19 @@ function trigger(el, event, opt){

function clone(obj, rep){
return Object.assign({}, obj, rep || {});
if(typeof Object.assign === "function"){
return Object.assign({}, obj, rep || {});
}
var clone = Object.constructor();
for(var key in obj){
clone[key] = (key in rep)? rep[key]: obj[key];
}
return clone;
}
function first(str){ return str.charAt(0).toUpperCase() + str.slice(1); };
function create(tag, classes){
var r = d.createElement(tag);
r.className = (classes && classes.join)? classes.join(" "): classes || "";
return r;
}
function first(str){
return str.charAt(0).toUpperCase() + str.slice(1);
}
function parse(str, time, reset){

@@ -75,3 +89,3 @@ var date = (str instanceof Date)? str: (str)? new Date(str): false;

return (time === true)? date.getTime(): date;
};
}

@@ -96,3 +110,3 @@ /*

// Check el
// Check Element
if(datetime.inst[el.getAttribute("data-tail-datetime")]){

@@ -113,5 +127,6 @@ return datetime.inst[el.getAttribute("data-tail-datetime")];

datetime.inst["tail-" + this.id] = this;
this.e.setAttribute("data-tail-datetime", "tail-" + this.id);
return this.init();
};
datetime.version = "0.4.12";
datetime.version = "0.4.13";
datetime.status = "beta";

@@ -125,31 +140,32 @@ datetime.count = 0;

datetime.defaults = {
animate: true,
classNames: false,
closeButton: true,
dateFormat: "YYYY-mm-dd",
dateStart: false,
dateRanges: [],
dateBlacklist: true,
dateEnd: false,
locale: "en",
position: "bottom",
rtl: "auto",
startOpen: false,
stayOpen: false,
timeFormat: "HH:ii:ss",
timeHours: null,
timeMinutes: null,
timeSeconds: 0,
timeIncrement: true,
timeStepHours: 1,
timeStepMinutes: 5,
timeStepSeconds: 5,
today: true,
tooltips: [],
viewDefault: "days",
viewDecades: true,
viewYears: true,
viewMonths: true,
viewDays: true,
weekStart: 0
animate: true, // [0.4.0] Boolean
classNames: false, // [0.3.0] Boolean, String, Array, null
closeButton: true, // [0.4.5] Boolean
dateFormat: "YYYY-mm-dd", // [0.1.0] String (PHP similar Date)
dateStart: false, // [0.4.0] String, Date, Integer, False
dateRanges: [], // [0.3.0] Array
dateBlacklist: true, // [0.4.0] Boolean
dateEnd: false, // [0.4.0] String, Date, Integer, False
locale: "en", // [0.4.0] String
position: "bottom", // [0.1.0] String
rtl: "auto", // [0.4.1] String, Boolean
startOpen: false, // [0.3.0] Boolean
stayOpen: false, // [0.3.0] Boolean
time12h: false, // [0.4.13][NEW] Boolean
timeFormat: "HH:ii:ss", // [0.1.0] String (PHP similar Date)
timeHours: true, // [0.4.13][UPD] Integer, Boolean, null
timeMinutes: true, // [0.4.13][UPD] Integer, Boolean, null
timeSeconds: 0, // [0.4.13][UPD] Integer, Boolean, null
timeIncrement: true, // [0.4.5] Boolean
timeStepHours: 1, // [0.4.3] Integer
timeStepMinutes: 5, // [0.4.3] Integer
timeStepSeconds: 5, // [0.4.3] Integer
today: true, // [0.4.0] Boolean
tooltips: [], // [0.4.0] Array
viewDefault: "days", // [0.4.0] String
viewDecades: true, // [0.4.0] Boolean
viewYears: true, // [0.4.0] Boolean
viewMonths: true, // [0.4.0] Boolean
viewDays: true, // [0.4.0] Boolean
weekStart: 0 // [0.1.0] String, Integer
};

@@ -196,13 +212,67 @@

| INTERNAL :: INIT CALENDAR
| @sicne 0.4.11 [0.2.0]
| @since 0.4.13 [0.2.0]
*/
init: function(){
var self = this, temp;
var self = this.prepare();
// Options
// Init Weekdays
var week = this.__["shorts"].slice(this.con.weekStart).concat(this.__["shorts"].slice(0, this.con.weekStart));
this.weekdays = "<thead>\n<tr>\n";
for(var i = 0; i < 7; i++){
this.weekdays += '<th class="calendar-week">' + week[i] + '</th>';
}
this.weekdays += "\n</tr>\n</thead>"
// Init Select
this.select = parse(this.e.getAttribute("data-value") || this.e.value);
if(!this.select || this.select < this.con.dateStart || this.select > this.con.dateEnd){
this.select = null;
}
// Init View
if(this.view == undefined){
this.view = {
type: this.con.viewDefault,
date: this.select || new Date()
};
}
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
if(typeof this.con["time" + l[i]] === "number"){
this.view.date["set" + l[i]](this.con["time" + l[i]]);
} else {
while(this.view.date["get" + l[i]]() % this.con["timeStep" + l[i]] !== 0){
this.view.date["set" + l[i]](this.view.date["get" + l[i]]() + 1);
}
}
}
this.ampm = this.view.date.getHours() > 12;
// Init Mains
this.events = {};
this.dt = this.renderCalendar();
// Store Instance and Return
if(this.con.startOpen){
this.open();
}
if(this.select){
this.selectDate(this.select);
}
return this.bind();
},
/*
| INTERNAL :: PREPARE CALENDAR
| @since 0.4.13 [0.4.13]
*/
prepare: function(){
this.__ = clone(datetime.strings.en, datetime.strings[this.con.locale] || {});
this.con.dateStart = parse(this.con.dateStart, true, true) || 0;
// Prepare Options
this.con.dateStart = parse(this.con.dateStart, true, true) || -9999999999999;
this.con.dateEnd = parse(this.con.dateEnd, true, true) || 9999999999999;
this.con.viewDefault = (!this.con.dateFormat)? "time": this.con.viewDefault;
if(typeof this.con.weekStart == "string"){
// Prepare Week Start
if(typeof this.con.weekStart === "string"){
this.con.weekStart = datetime.strings.en.shorts.indexOf(this.con.weekStart);

@@ -249,3 +319,3 @@ }

// Prepare Tooltips
// Preare Tooltips
if(this.con.tooltips.length > 0){

@@ -280,47 +350,28 @@ for(var r = [], t = this.con.tooltips, l = t.length, i = 0, s, e; i < l; i++){

}
return this;
},
// Prepare WeekDays
var week = this.__["shorts"].slice(this.con.weekStart).concat(this.__["shorts"].slice(0, this.con.weekStart));
this.weekdays = "<thead>\n<tr>\n";
for(var i = 0; i < 7; i++){
this.weekdays += '<th class="calendar-week">' + week[i] + '</th>';
}
this.weekdays += "\n</tr>\n</thead>"
/*
| INTERNAL :: BIND CALENDAR
| @since 0.4.13 [0.4.0]
*/
bind: function(){
var self = this;
// Set Main Data and Render
this.select = parse(this.e.getAttribute("data-value") || this.e.value);
if(!this.select || this.select < this.con.dateStart || this.select > this.con.dateEnd){
this.select = null;
}
if(this.view == undefined){
this.view = {
type: this.con.viewDefault,
date: this.select || new Date()
};
}
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
if(typeof this.con["time" + l[i]] == "number"){
this.view.date["set" + l[i]](this.con["time" + l[i]]);
}
}
this.events = {};
this.dt = this.renderCalendar();
// Hook Events
if(this._bind == undefined){
var e = "addEventListener";
this.e[e]("focusin", function(event){
// Bind Element
if(typeof this._bind === "undefined"){
this.e.addEventListener("focusin", function(event){
self.open.call(self);
});
this.e[e]("keyup", function(event){
self.bind.call(self, event);
this.e.addEventListener("keyup", function(event){
self.callback.call(self, event);
});
d[e]("keyup", function(event){
d.addEventListener("keyup", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
}
});
d[e]("click", function(event){
d.addEventListener("click", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
} else if(!self.e.contains(event.target) && cHAS(self.dt, "calendar-open")){

@@ -332,5 +383,5 @@ if(event.target != self.dt && event.target != self.e && !self.con.stayOpen){

});
d[e]("mouseover", function(event){
d.addEventListener("mouseover", function(event){
if(self.dt.contains(event.target)){
self.bind.call(self, event);
self.callback.call(self, event);
}

@@ -340,11 +391,2 @@ });

}
// Store Instance and Return
this.e.setAttribute("data-tail-datetime", "tail-" + this.id);
if(this.con.startOpen){
this.open();
}
if(this.select){
this.selectDate(this.select);
}
return this;

@@ -354,10 +396,10 @@ },

/*
| INTERNAL :: EVENT LISTENER
| @since 0.4.1 [0.4.0]
| INTERNAL :: HANDLE CALLBACKs
| @since 0.4.13 [0.4.13]
*/
bind: function(event){
callback: function(event){
var self = event.target, a = "getAttribute", d = "data-action", v = "data-view",
elem = self[a](d)? self: self.parentElement[a](d)? self.parentElement: self;
elem = self[a](d)? self: self.parentElement[a](d)? self.parentElement: self;
// Hover Events
// Bind HoverEvents
var t = "data-tooltip", tip;

@@ -374,3 +416,3 @@ if(event.type == "mouseover"){

// Click Events
// Bind ClickEvents
if(event.type == "click"){

@@ -387,2 +429,3 @@ if(!elem || (event.buttons != 1 && (event.which || event.button) != 1)){

return this.browseView(elem[a](d));
case "cancel":

@@ -393,2 +436,3 @@ if(!this.con.stayOpen){

break;
case "submit":

@@ -399,2 +443,3 @@ if(!this.con.stayOpen){

return this.selectDate(this.fetchDate(parseInt(elem[a]("data-date"))));
case "view":

@@ -406,3 +451,3 @@ this.switchDate(elem[a]("data-year") || null, elem[a]("data-month") || null, elem[a]("data-day") || null);

// KeyEvents
// Bind KeyEvents
if(event.type == "keyup"){

@@ -450,3 +495,3 @@ if(event.target.tagName != "INPUT" && event.target !== this.e){

| HELPER :: CALCULATE POSITION
| @since 0.4.2 [0.3.1]
| @since 0.4.13 [0.3.1]
*/

@@ -457,12 +502,10 @@ calcPosition: function(){

y = parseInt(b.marginTop) +parseInt(b.marginBottom),
p = (function(e, r){
r = {
top: e.offsetTop || 0, left: e.offsetLeft || 0,
width: e.offsetWidth || 0, height: e.offsetHeight || 0
};
while(e = e.offsetParent){ r.top += e.offsetTop; r.left += e.offsetLeft; }
return r;
})(this.e, {});
p = {
top: this.e.getBoundingClientRect().top + w.scrollY,
left: this.e.getBoundingClientRect().left - w.scrollX,
width: this.e.offsetWidth || 0,
height: this.e.offsetHeight || 0
};
// Set Position
// Calc Position
a.visibility = "hidden";

@@ -475,7 +518,7 @@ switch(this.con.position){

case "left":
var top = (p.top + p.height/2) - (this.dt.offsetHeight / 2 + y),
var top = (p.top + p.height / 2) - (this.dt.offsetHeight / 2 + y),
left = p.left - (this.dt.offsetWidth + x);
break;
case "right":
var top = (p.top + p.height/2) - (this.dt.offsetHeight / 2 + y),
var top = (p.top + p.height / 2) - (this.dt.offsetHeight / 2 + y),
left = p.left + p.width;

@@ -488,2 +531,4 @@ break;

}
// Set Position
a.top = ((top >= 0)? top: this.e.offsetTop) + "px";

@@ -528,43 +573,43 @@ a.left = ((left >= 0)? left: 0) + "px";

| RENDER :: CALENDAR
| @since 0.4.5 [0.4.0]
| @since 0.4.13 [0.4.0]
*/
renderCalendar: function(){
var _s, _c = ["tail-datetime-calendar", "calendar-close"], dt = d.createElement("DIV"),
_t = (this.con.classNames === true)? this.e.className: this.con.classNames;
var cls = ["tail-datetime-calendar", "calendar-close"],
cus = (this.con.classNames === true)? this.e.className.split(" "): this.con.classNames;
// Configure Calendar
// Classes
if(["top", "left", "right", "bottom"].indexOf(this.con.position) < 0){
_s = d.querySelector(this.con.position);
_c.push("calendar-static");
var sta = d.querySelector(this.con.position);
cls.push("calendar-static");
}
if(typeof _t == "string" || _t instanceof Array){
_c = _c.concat(((typeof _t == "string")? _t.split(" "): _t));
if(this.con.rtl === true || ["ar", "he", "mdr", "sam", "syr"].indexOf(this.con.rtl) >= 0){
cls.push("rtl");
}
var rtl = ["ar", "he", "mdr", "sam", "syr"], _rt = this.con.rtl;
if(_rt === true || (_rt === "auto" && rtl.indexOf(this.con.locale) >= 0)){
_c.push("rtl");
}
if(this.con.stayOpen){
_c.push("calendar-stay");
cls.push("calendar-stay");
}
// Customs
cus = (typeof cus.split === "function")? cus.split(" "): cus;
if(cus instanceof Array){
cls = cls.concat(cus);
}
// Create
var dt = create("DIV", cls), ins = false;
dt.id = "tail-datetime-" + this.id;
dt.className = _c.join(" ");
dt.style.cssText = (this.con.rtl)? "direction:rtl;": "direction:ltr;";
// Render Action
// Render Actions
if(this.con.dateFormat){
var _a = '<span class="action action-prev" data-action="prev"></span>'
+ '<span class="label" data-action="view" data-view="up"></span>'
+ '<span class="action action-next" data-action="next"></span>'
ins = '<span class="action action-prev" data-action="prev"></span>'
+ '<span class="label" data-action="view" data-view="up"></span>'
+ '<span class="action action-next" data-action="next"></span>';
} else if(this.con.timeFormat){
var _a = '<span class="action action-submit" data-action="submit"></span>'
+ '<span class="label"></span>'
+ '<span class="action action-cancel" data-action="cancel"></span>'
ins = '<span class="action action-submit" data-action="submit"></span>'
+ '<span class="label"></span>'
+ '<span class="action action-cancel" data-action="cancel"></span>';
}
if(typeof _a != "undefined"){
dt.innerHTML = '<div class="calendar-actions">' + _a + '</div>';
}
dt.innerHTML = (ins)? '<div class="calendar-actions">' + ins + '</div>': '';
// Render Date and Time Picker
// Render Interfaces
if(this.con.dateFormat){

@@ -577,6 +622,5 @@ this.renderDatePicker(dt, this.con.viewDefault);

// Render Close Button
if(this.con.closeButton && !_s){
var close = d.createElement("BUTTON"), self = this;
close.className = "calendar-close";
// Render Close
if(this.con.closeButton && !sta){
var close = create("BUTTON", "calendar-close"), self = this;
close.addEventListener("click", function(event){

@@ -590,8 +634,3 @@ event.preventDefault();

// Append Calendar
if(_s){
dt.style.cssText = 'position:static;visibility:visible;';
} else {
dt.style.cssText = 'top:0;left:0;z-index:999;position:absolute;visibility:hidden;';
}
(_s || document.body).appendChild(dt);
(sta || d.body).appendChild(dt);
return dt;

@@ -628,72 +667,157 @@ },

| RENDER :: TIME PICKER
| @since 0.4.5 [0.4.0]
| @since 0.4.13 [0.4.0]
*/
renderTimePicker: function(dt){
if(!this.con.timeFormat){ return false; }
var h = this.con.timeStepHours, m = this.con.timeStepMinutes, s = this.con.timeStepSeconds;
h ='<div class="timepicker-field timepicker-hours">'
+ '<input type="number" name="dt[h]" value="" min="00" max="23" step="' + h + '" />'
+ '<label>' + this.__["time"][0] + '</label>'
+ '</div>',
m = '<div class="timepicker-field timepicker-minutes">'
+ '<input type="number" name="dt[m]" value="" min="00" max="59" step="' + m + '" />'
+ '<label>' + this.__["time"][1] + '</label>'
+ '</div>',
s = '<div class="timepicker-field timepicker-seconds">'
+ '<input type="number" name="dt[s]" value="" min="00" max="59" step="' + s + '" />'
+ '<label>' + this.__["time"][2] + '</label>'
+ '</div>';
if(!this.con.timeFormat){
return false;
}
var fields = [], input, i = 0;
// AM | PM Switch
if(this.con.time12h){
var checked = (this.view.date.getHours() > 12)? 'checked="checked" ': '';
fields.push(
'<label class="timepicker-switch" data-am="AM" data-pm="PM">' +
'<input type="checkbox" value="1" data-input="PM" ' + checked + '/><span></span>' +
'</label>'
);
}
// Hours & Minutes & Seconds
for(var key in { Hours: 0, Minutes: 0, Seconds: 0 }){
if(this.con["time" + key] === false){
fields.push((i++)? null: null);
continue;
}
input = d.createElement("INPUT");
input.type = "text";
input.disabled = (this.con["time" + key] === null);
input.setAttribute("min", (key === "Hours" && this.con.time12h)? "01": "00");
input.setAttribute("max", (key !== "Hours")? "60": (this.con.time12h)? "13": "24");
input.setAttribute("step", this.con["timeStep" + key]);
input.setAttribute("value", function(n){ return (n < 10)? "0" + n: n; }(this.view.date["get" + key]()));
input.setAttribute("pattern", "\d*");
input.setAttribute("inputmode", "numeric");
input.setAttribute("data-input", key.toLowerCase());
fields.push(
'<div class="timepicker-field timepicker-' + key.toLowerCase() + '">' +
input.outerHTML +
'<button class="picker-step step-up"></button>' +
'<button class="picker-step step-down"></button>' +
'<label>' + this.__["time"][i++] + '</label>' +
'</div>'
);
}
// Render View
var div = d.createElement("DIV");
div.className = "calendar-timepicker";
div.innerHTML = h + m + s;
var div = create("DIV", "calendar-timepicker"), self = this;
div.innerHTML = fields.join("\n");
// Set Data
var self = this, inp = div.querySelectorAll("input");
for(var l = ["Hours", "Minutes", "Seconds"], i = 0; i < 3; i++){
inp[i].value = this.view.date["get" + l[i]]();
inp[i].disabled = (this.con["time" + l[i]] === false);
inp[i].addEventListener("input", function(ev){ self.handleTime.call(self, ev, this) });
inp[i].addEventListener("keydown", function(ev){ self.handleTime.call(self, ev, this) });
// Bind Input
for(var inp = div.querySelectorAll("input"), i = 0; i < inp.length; i++){
if(inp[i].type === "checkbox"){
inp[i].addEventListener("change", function(ev){
self.handleTime.call(self, this);
});
continue;
}
inp[i].addEventListener("input", function(ev){
self.handleTime.call(self, this);
});
inp[i].addEventListener("keydown", function(ev){
var key = event.keyCode || event.which || 0;
if(key === 38 || key === 40){
ev.preventDefault();
self.handleStep.call(self, this, (key === 38? "up": "down"));
return false;
}
});
}
// Bind Buttons
for(var inp = div.querySelectorAll("button"), i = 0; i < inp.length; i++){
inp[i].addEventListener("mousedown", function(ev){
ev.preventDefault();
var input = this.parentElement.querySelector("input");
self.handleStep.call(self, input, cHAS(this, "step-up")? "up": "down");
return false;
});
}
// Append Element
if(dt.querySelector(".calendar-timepicker")){
dt.replaceChild(div, dt.querySelector(".calendar-timepicker"));
var ct = dt.querySelector(".calendar-timepicker");
dt[(ct)? "replaceChild": "appendChild"](div, ct);
return this.handleLabel(dt);
},
/*
| HANDLE :: TIME FIELD
| @since 0.4.13 [0.4.5]
*/
handleTime: function(input){
if(this.con.time12h && input.type === "checkbox"){
this.ampm = input.checked;
}
// Select Time
var time = input.parentElement.parentElement;
time = [
(time.querySelector("input[data-input=hours]") || {value: 0}),
(time.querySelector("input[data-input=minutes]") || {value: 0}),
(time.querySelector("input[data-input=seconds]") || {value: 0})
];
this.selectTime(
parseInt(time[0].value) + (this.ampm? 12: 0),
parseInt(time[1].value),
parseInt(time[2].value)
);
// Handle Values
time[2].value = this.view.date.getSeconds();
time[1].value = this.view.date.getMinutes();
if(this.con.time12h){
time[0].value = (this.view.date.getHours() > 12)? this.view.date.getHours() - 12: this.view.date.getHours();
} else {
dt.appendChild(div);
time[0].value = this.view.date.getHours();
}
return this.handleLabel(dt);
},
/*
| HANDLE :: TIME FIELDs
| @since 0.4.5 [0.4.5]
| HANDLE :: TIME STEPs
| @since 0.4.13 [0.4.13]
*/
handleTime: function(event, element){
var min = parseInt(element.getAttribute("min")),
max = parseInt(element.getAttribute("max")),
step = parseInt(element.getAttribute("step")),
value = parseInt(element.value), action = "none";
handleStep: function(input, action, prevent){
var inc = false;
var name = input.getAttribute("data-input");
var step = this.con["timeStep" + first(name)];
var value = parseInt(input.value);
var limit = (name !== "hours")? 60: (this.con.time12h)? 13: 24;
if((event.keyCode || event.which) == 38 || value > max){
var action = "up";
} if((event.keyCode || event.which) == 40 || value < min){
var action = "down";
// Calculate
if(action === "up" && value + step >= limit){
inc = this.con.timeIncrement && limit === 60;
input.value = (limit === 13)? 1: 0;
this.ampm = (this.view.date.getHours() + 1) >= 12;
} else if(action === "down" && value - step < (limit === 13? 1: 0)){
inc = this.con.timeIncrement && limit === 60;
input.value = limit - step;
this.ampm = (this.view.date.getHours() - 1) <= 0;
} else {
input.value = (action === "up")? value + step: value - step;
}
// Increase Time
if(action == "up" && value + step > max){
var add = 1;
element.value = value - (max+1);
} else if(action == "down" && value - step < 0){
var add = -1;
element.value = (max+1) + value;
// Leading Zero
if(input.value < 10){
input.value = "0" + input.value;
}
if(add && this.con.timeIncrement && element.parentElement.previousElementSibling){
var next = element.parentElement.previousElementSibling.querySelector("input");
if(next.disabled === false){
next.value = parseInt(next.value) + add;
return this.handleTime({}, next);
// Increment
if(inc){
var prev = input.parentElement.previousElementSibling.querySelector("input");
if(prev && prev.disabled === false){
this.handleStep(prev, action, true);
}

@@ -703,4 +827,20 @@ }

// Set Time
var time = element.parentElement.parentElement.querySelectorAll("input");
this.selectTime(time[0].value, time[1].value, time[2].value);
if(typeof prevent !== "undefined" && prevent === true){
return false;
}
var time = input.parentElement.parentElement;
this.selectTime(
parseInt((time.querySelector("input[data-input=hours]") || {value: 0}).value) + (this.ampm? 12: 0),
parseInt((time.querySelector("input[data-input=minutes]") || {value: 0}).value),
parseInt((time.querySelector("input[data-input=seconds]") || {value: 0}).value)
);
// Check AM/PM
if(this.con.time12h){
var ampm = input.parentElement.parentElement.querySelector("input[type=checkbox]");
if(ampm && ampm.checked !== this.view.date.getHours() > 12){
ampm.checked = this.view.date.getHours() > 12;
}
}
return true;
},

@@ -716,13 +856,22 @@

case "days":
text = this.__["months"][this.view.date.getMonth()] + ", " + this.view.date.getFullYear(); break;
text = this.__["months"][this.view.date.getMonth()] + ", " + this.view.date.getFullYear();
break;
case "months":
text = this.view.date.getFullYear(); break;
text = this.view.date.getFullYear();
break;
case "years":
year = parseInt((this.view.date.getFullYear()).toString().slice(0, 3) + "0");
text = year + " - " + (year+10); break;
text = year + " - " + (year+10);
break;
case "decades":
year = parseInt((this.view.date.getFullYear()).toString().slice(0, 2) + "00");
text = year + " - " + (year+100); break;
text = year + " - " + (year+100);
break;
case "time":
text = this.__.header[3];
break;
}

@@ -1092,3 +1241,3 @@ label.innerText = text;

| PUBLIC :: OPEN CALENDAR
| @since 0.4.0 [0.1.0]
| @since 0.4.13 [0.1.0]
*/

@@ -1102,8 +1251,13 @@ open: function(){

// Animate
e.opacity = this.con.animate? 0: 1; e.display = "block";
cADD(cREM(this.dt, "calendar-close"), "calender-idle");
cHAS(this.dt, "calendar-static")? null: this.calcPosition();
e.display = "block";
e.opacity = (this.con.animate)? 0: 1;
cREM(this.dt, "calendar-close");
cADD(this.dt, "calendar-idle");
if(!cHAS(this.dt, "calendar-static")){
self.calcPosition();
}
(function fade(){
if((e.opacity = parseFloat(e.opacity)+0.125) >= 1){
cADD(cREM(self.dt, "calendar-idle"), "calendar-open");
cREM(self.dt, "calendar-idle");
cADD(self.dt, "calendar-open");
return self.trigger("open");

@@ -1118,3 +1272,3 @@ }

| PUBLIC :: CLOSE CALENDAR
| @since 0.4.0 [0.1.0]
| @since 0.4.13 [0.1.0]
*/

@@ -1128,7 +1282,10 @@ close: function(){

// Animate
cADD(cREM(this.dt, "calendar-open"), "calender-idle");
e.opacity = this.con.animate? 1: 0; e.display = "block";
e.display = "block";
e.opacity = (this.con.animate)? 1: 0;
cREM(this.dt, "calendar-open");
cADD(this.dt, "calendar-idle");
(function fade(){
if((e.opacity -= 0.125) <= 0){
cADD(cREM(self.dt, "calendar-idle"), "calendar-close");
cREM(self.dt, "calendar-idle");
cADD(self.dt, "calendar-close");
e.display = "none";

@@ -1217,3 +1374,3 @@ return self.trigger("close");

}
}
};

@@ -1220,0 +1377,0 @@ // Return

@@ -1,2 +0,2 @@

/* pytesNET/tail.DateTime v.0.4.12 | Basic Version | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(t):(void 0===t.tail&&(t.tail={}),t.tail.DateTime=t.tail.datetime=e(t),"undefined"!=typeof jQuery&&(jQuery.fn.DateTime=jQuery.fn.datetime=function(t){var e,i=[];return this.each(function(){!1!==(e=tail.DateTime(this,t))&&i.push(e)}),1===i.length?i[0]:0!==i.length&&i}),"undefined"!=typeof MooTools&&(Element.implement({DateTime:function(t){return new tail.DateTime(this,t)}}),Element.implement({datetime:function(t){return new tail.DateTime(this,t)}})))}(this,function(t){"use strict";var o=t,c=t.document;function d(t,e){return!!t.classList&&t.classList.contains(e)}function a(t,e){return!!t.classList&&(t.classList.add(e),t)}function n(t,e){return!!t.classList&&(t.classList.remove(e),t)}function s(t,e,i){if(CustomEvent&&CustomEvent.name)var a=new CustomEvent(e,i);else(a=c.createEvent("CustomEvent")).initCustomEvent(e,!!i.bubbles,!!i.cancelable,i.detail);return t.dispatchEvent(a)}function h(t,e){return Object.assign({},t,e||{})}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}function u(t,e,i){var a=t instanceof Date?t:!!t&&new Date(t);return a instanceof Date&&!isNaN(a.getDate())&&(i&&a.setHours(0,0,0,0),!0===e?a.getTime():a)}var p=function(t,e){if((t="string"==typeof t?c.querySelectorAll(t):t)instanceof NodeList||t instanceof HTMLCollection||t instanceof Array){for(var i=[],a=t.length,n=0;n<a;n++)i.push(new p(t[n],e));return 1===i.length?i[0]:0!==i.length&&i}if(!(t instanceof Element))return!1;if(!(this instanceof p))return new p(t,e);if(p.inst[t.getAttribute("data-tail-datetime")])return p.inst[t.getAttribute("data-tail-datetime")];if(t.getAttribute("data-datetime")){var s=JSON.parse(t.getAttribute("data-datetime").replace(/\'/g,'"'));s instanceof Object&&(e=h(e,s))}return this.e=t,this.id=++p.count,this.con=h(p.defaults,e),(p.inst["tail-"+this.id]=this).init()};return p.version="0.4.12",p.status="beta",p.count=0,p.inst={},p.defaults={animate:!0,classNames:!1,closeButton:!0,dateFormat:"YYYY-mm-dd",dateStart:!1,dateRanges:[],dateBlacklist:!0,dateEnd:!1,locale:"en",position:"bottom",rtl:"auto",startOpen:!1,stayOpen:!1,timeFormat:"HH:ii:ss",timeHours:null,timeMinutes:null,timeSeconds:0,timeIncrement:!0,timeStepHours:1,timeStepMinutes:5,timeStepSeconds:5,today:!0,tooltips:[],viewDefault:"days",viewDecades:!0,viewYears:!0,viewMonths:!0,viewDays:!0,weekStart:0},p.strings={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorts:["SUN","MON","TUE","WED","THU","FRI","SAT"],time:["Hours","Minutes","Seconds"],header:["Select a Month","Select a Year","Select a Decade","Select a Time"]},modify:function(t,e,i){if(!(t in this))return!1;if(e instanceof Object)for(var a in e)this.modify(t,a,e[a]);else this[t][e]="string"==typeof i?i:this[t][e];return!0},register:function(t,e){return"string"==typeof t&&e instanceof Object&&(this[t]=e,!0)}},p.prototype={init:function(){var t,e=this;if(this.__=h(p.strings.en,p.strings[this.con.locale]||{}),this.con.dateStart=u(this.con.dateStart,!0,!0)||0,this.con.dateEnd=u(this.con.dateEnd,!0,!0)||9999999999999,this.con.viewDefault=this.con.dateFormat?this.con.viewDefault:"time","string"==typeof this.con.weekStart&&(this.con.weekStart=p.strings.en.shorts.indexOf(this.con.weekStart)),this.con.weekStart<0&&6<this.con.weekStart&&(this.con.weekStart=0),0<this.con.dateRanges.length){for(var i=[],a=(l=this.con.dateRanges).length,n=0;n<a;n++)l[n]instanceof Object&&(l[n].start||l[n].days)&&(!1===(l[n].start=u(l[n].start||!1,!0,!0))?l[n].start=l[n].end=1/0:(!1===(l[n].end=u(l[n].end||!1,!0,!0))&&(l[n].end=l[n].start),l[n].start=l[n].start>l[n].end?[l[n].end,l[n].end=l[n].start][0]:l[n].start),l[n].days=!("days"in l[n])||l[n].days,l[n].days="boolean"!=typeof l[n].days?function(t){for(var e=[],i=t.length,a=0;a<i;a++)"string"==typeof t[a]&&(t[a]=p.strings.en.shorts.indexOf(t[a])),0<=t[a]&&t[a]<=6&&e.push(t[a]);return e}(l[n].days instanceof Array?l[n].days:[l[n].days]):[0,1,2,3,4,5,6],i.push({start:l[n].start,end:l[n].end,days:l[n].days}));this.con.dateRanges=i}if(0<this.con.tooltips.length){i=[];var s,r=this.con.tooltips;for(a=r.length,n=0;n<a;n++)r[n]instanceof Object&&r[n].date&&(r[n].date instanceof Array?(s=u(r[n].date[0]||!1,!0,!0),l=u(r[n].date[1]||!1,!0,!0)||s):s=l=u(r[n].date||!1,!0,!0),s&&i.push({date:s!==l?[s,l]:s,text:r[n].text||"Tooltip",color:r[n].color||"inherit",element:r[n].element||(t=c.createElement("DIV"),t.className="calendar-tooltip",t.innerHTML='<div class="tooltip-inner">'+r[n].text||"Tooltip</div>",t)}));this.con.tooltips=i}var o=this.__.shorts.slice(this.con.weekStart).concat(this.__.shorts.slice(0,this.con.weekStart));this.weekdays="<thead>\n<tr>\n";for(n=0;n<7;n++)this.weekdays+='<th class="calendar-week">'+o[n]+"</th>";this.weekdays+="\n</tr>\n</thead>",this.select=u(this.e.getAttribute("data-value")||this.e.value),(!this.select||this.select<this.con.dateStart||this.select>this.con.dateEnd)&&(this.select=null),null==this.view&&(this.view={type:this.con.viewDefault,date:this.select||new Date});for(a=["Hours","Minutes","Seconds"],n=0;n<3;n++)"number"==typeof this.con["time"+a[n]]&&this.view.date["set"+a[n]](this.con["time"+a[n]]);if(this.events={},this.dt=this.renderCalendar(),null==this._bind){var l="addEventListener";this.e[l]("focusin",function(t){e.open.call(e)}),this.e[l]("keyup",function(t){e.bind.call(e,t)}),c[l]("keyup",function(t){e.dt.contains(t.target)&&e.bind.call(e,t)}),c[l]("click",function(t){e.dt.contains(t.target)?e.bind.call(e,t):!e.e.contains(t.target)&&d(e.dt,"calendar-open")&&(t.target==e.dt||t.target==e.e||e.con.stayOpen||e.close.call(e))}),c[l]("mouseover",function(t){e.dt.contains(t.target)&&e.bind.call(e,t)}),this._bind=!0}return this.e.setAttribute("data-tail-datetime","tail-"+this.id),this.con.startOpen&&this.open(),this.select&&this.selectDate(this.select),this},bind:function(t){var e,i=t.target,a="getAttribute",n="data-action",s=i[a](n)?i:i.parentElement[a](n)?i.parentElement:i,r="data-tooltip";if("mouseover"==t.type&&(!1!==(e=i[a](r)?i:!!s[a](r)&&s)?this.dt.querySelector("#tooltip-"+e[a](r)+"-"+e[a](r+"-time"))||this.showTooltip(e[a](r),e,e[a](r+"-time")):this.dt.querySelector(".calendar-tooltip:not(.remove)")&&this.hideTooltip(this.dt.querySelector(".calendar-tooltip").id.slice(8))),"click"==t.type){if(!s||1!=t.buttons&&1!=(t.which||t.button))return;if(s.hasAttribute("data-disabled"))return;switch(s[a](n)){case"prev":case"next":return this.browseView(s[a](n));case"cancel":this.con.stayOpen||this.close();break;case"submit":return this.con.stayOpen||this.close(),this.selectDate(this.fetchDate(parseInt(s[a]("data-date"))));case"view":return this.switchDate(s[a]("data-year")||null,s[a]("data-month")||null,s[a]("data-day")||null),this.switchView(s[a]("data-view"))}}if("keyup"==t.type){if("INPUT"!=t.target.tagName&&t.target!==this.e&&/calendar-(static|close)/i.test(this.dt.className))return!1;13==(t.keyCode||t.which)&&(this.selectDate(this.fetchDate(this.select)),t.stopPropagation(),this.con.stayOpen||this.close()),27==(t.keyCode||t.which)&&(this.con.stayOpen||this.close())}},trigger:function(t){var e={bubbles:!1,cancelable:!0,detail:{args:arguments,self:this}};"change"==t&&(s(this.e,"input",e),s(this.e,"change",e)),s(this.dt,"tail::"+t,e);for(var i=(this.events[t]||[]).length,a=0;a<i;a++)this.events[t][a].cb.apply(this,function(t,e,i){for(var a=e.length,n=0;n<a;++n)t[n-1]=e[n];return t[n]=i,t}(new Array(arguments.length),arguments,this.events[t][a].args));return!0},calcPosition:function(){var t=this.dt.style,e=o.getComputedStyle(this.dt),i=parseInt(e.marginLeft)+parseInt(e.marginRight),a=parseInt(e.marginTop)+parseInt(e.marginBottom),n=function(t,e){for(e={top:t.offsetTop||0,left:t.offsetLeft||0,width:t.offsetWidth||0,height:t.offsetHeight||0};t=t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft;return e}(this.e,{});switch(t.visibility="hidden",this.con.position){case"top":var s=n.top-(this.dt.offsetHeight+a),r=n.left+n.width/2-(this.dt.offsetWidth/2+i/2);break;case"left":s=n.top+n.height/2-(this.dt.offsetHeight/2+a),r=n.left-(this.dt.offsetWidth+i);break;case"right":s=n.top+n.height/2-(this.dt.offsetHeight/2+a),r=n.left+n.width;break;default:s=n.top+n.height,r=n.left+n.width/2-(this.dt.offsetWidth/2+i/2)}return t.top=(0<=s?s:this.e.offsetTop)+"px",t.left=(0<=r?r:0)+"px",t.visibility="visible",this},convertDate:function(t,e){var i,a={H:String("00"+t.getHours()).toString().slice(-2),G:(i=t.getHours(),i%12?i%12:12),A:12<=t.getHours()?"PM":"AM",a:12<=t.getHours()?"pm":"am",i:String("00"+t.getMinutes()).toString().slice(-2),s:String("00"+t.getSeconds()).toString().slice(-2),Y:t.getFullYear(),y:parseInt(t.getFullYear().toString().slice(2)),m:String("00"+(t.getMonth()+1)).toString().slice(-2),M:this.__.months[t.getMonth()].slice(0,3),F:this.__.months[t.getMonth()],d:String("00"+t.getDate()).toString().slice(-2),D:this.__.days[t.getDay()],l:this.__.shorts[t.getDay()].toLowerCase()};return e.replace(/([HGismd]{1,2}|[Y]{2,4}|y{2})/g,function(t){return 4==t.length||2==t.length?a[t.slice(-1)].toString().slice(-Math.abs(t.length)):1==t.length&&"0"==t[0]?a[t.slice(-1)].toString().slice(-1):a[t.slice(-1)].toString()}).replace(/(A|a|M|F|D|l)/g,function(t){return a[t]})},renderCalendar:function(){var t,e=["tail-datetime-calendar","calendar-close"],i=c.createElement("DIV"),a=!0===this.con.classNames?this.e.className:this.con.classNames;["top","left","right","bottom"].indexOf(this.con.position)<0&&(t=c.querySelector(this.con.position),e.push("calendar-static")),("string"==typeof a||a instanceof Array)&&(e=e.concat("string"==typeof a?a.split(" "):a));var n=this.con.rtl;if((!0===n||"auto"===n&&0<=["ar","he","mdr","sam","syr"].indexOf(this.con.locale))&&e.push("rtl"),this.con.stayOpen&&e.push("calendar-stay"),i.id="tail-datetime-"+this.id,i.className=e.join(" "),i.style.cssText=this.con.rtl?"direction:rtl;":"direction:ltr;",this.con.dateFormat)var s='<span class="action action-prev" data-action="prev"></span><span class="label" data-action="view" data-view="up"></span><span class="action action-next" data-action="next"></span>';else if(this.con.timeFormat)s='<span class="action action-submit" data-action="submit"></span><span class="label"></span><span class="action action-cancel" data-action="cancel"></span>';if(void 0!==s&&(i.innerHTML='<div class="calendar-actions">'+s+"</div>"),this.con.dateFormat&&this.renderDatePicker(i,this.con.viewDefault),this.con.timeFormat&&this.renderTimePicker(i),this.con.closeButton&&!t){var r=c.createElement("BUTTON"),o=this;r.className="calendar-close",r.addEventListener("click",function(t){t.preventDefault(),o.close()}),i.appendChild(r)}return i.style.cssText=t?"position:static;visibility:visible;":"top:0;left:0;z-index:999;position:absolute;visibility:hidden;",(t||document.body).appendChild(i),i},renderDatePicker:function(t,e){if((!e||["decades","years","months","days"].indexOf(e)<0)&&(e=this.con.viewDays?"days":this.con.viewMonths?"months":this.con.viewYears?"years":!!this.con.viewDecades&&"decades"),!e||!this.con["view"+r(e)]||!this.con.dateFormat)return!1;var i=c.createElement("DIV");return i.className="calendar-datepicker calendar-view-"+e,i.innerHTML=this["view"+r(e)](),t.querySelector(".calendar-datepicker")?t.replaceChild(i,t.querySelector(".calendar-datepicker")):t.appendChild(i),this.view.type=e,this.handleLabel(t)},renderTimePicker:function(t){if(!this.con.timeFormat)return!1;var e=this.con.timeStepHours,i=this.con.timeStepMinutes,a=this.con.timeStepSeconds;e='<div class="timepicker-field timepicker-hours"><input type="number" name="dt[h]" value="" min="00" max="23" step="'+e+'" /><label>'+this.__.time[0]+"</label></div>",i='<div class="timepicker-field timepicker-minutes"><input type="number" name="dt[m]" value="" min="00" max="59" step="'+i+'" /><label>'+this.__.time[1]+"</label></div>",a='<div class="timepicker-field timepicker-seconds"><input type="number" name="dt[s]" value="" min="00" max="59" step="'+a+'" /><label>'+this.__.time[2]+"</label></div>";var n=c.createElement("DIV");n.className="calendar-timepicker",n.innerHTML=e+i+a;for(var s=this,r=n.querySelectorAll("input"),o=["Hours","Minutes","Seconds"],l=0;l<3;l++)r[l].value=this.view.date["get"+o[l]](),r[l].disabled=!1===this.con["time"+o[l]],r[l].addEventListener("input",function(t){s.handleTime.call(s,t,this)}),r[l].addEventListener("keydown",function(t){s.handleTime.call(s,t,this)});return t.querySelector(".calendar-timepicker")?t.replaceChild(n,t.querySelector(".calendar-timepicker")):t.appendChild(n),this.handleLabel(t)},handleTime:function(t,e){var i=parseInt(e.getAttribute("min")),a=parseInt(e.getAttribute("max")),n=parseInt(e.getAttribute("step")),s=parseInt(e.value),r="none";if(38==(t.keyCode||t.which)||a<s)r="up";if(40==(t.keyCode||t.which)||s<i)r="down";if("up"==r&&a<s+n){var o=1;e.value=s-(a+1)}else if("down"==r&&s-n<0){o=-1;e.value=a+1+s}if(o&&this.con.timeIncrement&&e.parentElement.previousElementSibling){var l=e.parentElement.previousElementSibling.querySelector("input");if(!1===l.disabled)return l.value=parseInt(l.value)+o,this.handleTime({},l)}var c=e.parentElement.parentElement.querySelectorAll("input");this.selectTime(c[0].value,c[1].value,c[2].value)},handleLabel:function(t){var e,i,a=t.querySelector(".label");switch(this.view.type){case"days":e=this.__.months[this.view.date.getMonth()]+", "+this.view.date.getFullYear();break;case"months":e=this.view.date.getFullYear();break;case"years":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,3)+"0"))+" - "+(i+10);break;case"decades":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,2)+"00"))+" - "+(i+100);break;case"time":e=this.__.header[3]}return a.innerText=e,t},viewDecades:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-30);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-decade"+(i>=e.getYear()&&i<=e.getYear()+10?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+" - "+(e.getFullYear()+10)+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+10);return'<table class="calendar-decades"><thead><tr><th colspan="4">'+this.__.header[2]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewYears:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-2);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-year"+(e.getYear()==i?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+1);return'<table class="calendar-years"><thead><tr><th colspan="4">'+this.__.header[1]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewMonths:function(){var t=this.__.months,e=this.con.today?(new Date).getMonth():-1;e=this.view.date.getYear()==(new Date).getYear()?e:-1;for(var i,a,n=[],s=[],r=0;r<12;r++)i="calendar-month"+(e==r?" date-today":""),a='data-action="view" data-view="down" data-month="'+r+'"',n.push('<td class="'+i+'" '+a+'><span class="inner">'+t[r]+"</span></td>"),3==n.length&&(s.push("<tr>\n"+n.join("\n")+"\n</tr>"),n=[]);return'<table class="calendar-months"><thead><tr><th colspan="3">'+this.__.header[0]+"</th></tr></thead><tbody>"+s.join("\n")+"</tbody></table>"},viewDays:function(){var i,t,e,a,n,s=new Date(this.view.date.getTime()),r=(new Date).toDateString(),o=s.getMonth(),l=[],c=[],d=[0,[]],h=[].concat(this.con.dateRanges),u=([].concat(this.con.tooltips),[0,0]);for(s.setHours(0,0,0,0),s.setDate(1),s.setDate(1-(s.getDay()-this.con.weekStart));c.length<6;)i=s.getTime(),e='data-action="submit" data-date="'+s.getTime()+'"',t="calendar-day date-"+(s.getMonth()>o?"next":s.getMonth()<o?"previous":"current"),this.con.today&&r==s.toDateString()&&(t+=" date-today"),this.con.dateBlacklist&&(i<this.con.dateStart||i>this.con.dateEnd)?d=[i<this.con.dateStart?this.con.dateStart:1/0,[0,1,2,3,4,5,6],!0]:0==d[0]?h=h.filter(function(t){return t.start==1/0||i>=t.start&&i<=t.end?!(d=[t.end,t.days]):t.start>i},this):3==d.length&&(d=[0,[0,1,2,3,4,5,6]]),0<this.con.tooltips.length&&this.con.tooltips.filter(function(t,e){t.date instanceof Array?t.date[0]<=i&&t.date[1]>=i&&(u=[t.date[1],e,t.color]):t.date==i&&(u=[t.date,e,t.color])},this),u[0]<i&&(u=[0,0]),(n=d[0]>=i&&0<=d[1].indexOf(s.getDay()))&&this.con.dateBlacklist||!n&&!this.con.dateBlacklist?(t+=" date-disabled",e+=' data-disabled="true"'):0!==d[0]&&d[0]<=i&&(d=[0,[]]),this.select&&this.select.toDateString()==s.toDateString()&&(t+=" date-select"),a='<span class="inner">'+s.getDate()+"</span>",0<u[0]&&(t+=" date-tooltip",e+=' data-tooltip="'+u[1]+'" data-tooltip-time="'+i+'"',"inherit"!==u[2]?a+='<span class="tooltip-tick" style="background:'+u[2]+';"></span>':a+='<span class="tooltip-tick"></span>'),l.push('<td class="'+t+'" '+e+">"+a+"</td>"),7==l.length&&(c.push("<tr>\n"+l.join("\n")+"\n</tr>"),l=[]),s.setDate(s.getDate()+1);return c="<tbody>"+c.join("\n")+"</tbody>",'<table class="calendar-days">'+this.weekdays+c+"</table>"},showTooltip:function(t,e,i){var a,n=this.con.tooltips[t].element,s=n.style,r=this.dt.querySelector(".calendar-datepicker");s.cssText="opacity:0;visibility:hidden;",n.id="tooltip-"+t+"-"+i,r.appendChild(n),a=n.offsetWidth,n.offsetHeight,s.top=e.offsetTop+e.offsetHeight+"px",s.left=e.offsetLeft+e.offsetWidth/2-a/2+"px",s.visibility="visible",this.con.animate?(n.setAttribute("data-top",parseInt(s.top)),s.top=parseInt(s.top)+5+"px",function t(){parseFloat(s.top)>n.getAttribute("data-top")&&(s.top=parseFloat(s.top)-.5+"px"),(s.opacity=parseFloat(s.opacity)+.125)<1&&setTimeout(t,20)}()):s.opacity=1},hideTooltip:function(t){var e=this.dt.querySelector("#tooltip-"+t),i=e.style;this.con.animate?(e.className+=" remove",function t(){if(parseFloat(i.top)<parseInt(e.getAttribute("data-top"))+5&&(i.top=parseFloat(i.top)+.5+"px"),(i.opacity-=.125)<0)return(e.className="calendar-tooltip")?e.parentElement.removeChild(e):"";setTimeout(t,20)}()):e.parentElement.removeChild(e)},switchView:function(t){var e=[null,"days","months","years","decades",null];return-1==e.indexOf(t)&&("up"==t?t=e[(e.indexOf(this.view.type)||5)+1]||null:"down"==t&&(t=e[(e.indexOf(this.view.type)||1)-1]||null),t&&this.con["view"+r(t)]||(t=!1)),!!t&&(this.renderDatePicker(this.dt,t),this.trigger("view",t))},switchDate:function(t,e,i,a){if(this.view.date.setFullYear(null==t?this.view.date.getFullYear():t),this.view.date.setMonth(null==e?this.view.date.getMonth():e),"auto"==i){var n=this.view.date,s=new Date;i=n.getMonth()==s.getMonth()&&n.getYear()==s.getYear()?s.getDate():1}return this.view.date.setDate(i||this.view.date.getDate()),!0===a||this.switchView(this.view.type)},switchMonth:function(t,e){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getMonth()+type),this.switchDate(e||this.getFullYear(),t)},switchYear:function(t){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getFullYear()+type),this.switchDate(t)},browseView:function(t){switch(t=0<=["previous","prev"].indexOf(t)?-1:1,this.view.type){case"days":return this.switchDate(null,this.view.date.getMonth()+t,"auto");case"months":return this.switchDate(this.view.date.getFullYear()+t,null,"auto");case"years":return this.switchDate(this.view.date.getFullYear()+10*t,null,"auto");case"decades":return this.switchDate(this.view.date.getFullYear()+100*t,null,"auto")}return!1},fetchDate:function(t){t=u(t||!1)||this.view.date;var e=this.dt.querySelectorAll("input[type=number]");return e&&3==e.length&&t.setHours(e[0].value||0,e[1].value||0,e[2].value||0,0),t},selectDate:function(t,e,i,a,n,s){var r=new Date,o=[];return this.con.dateFormat&&o.push(this.con.dateFormat),this.con.timeFormat&&o.push(this.con.timeFormat),this.select=t instanceof Date?t:new Date(t||(null==t?this.view.date.getFullYear():r.getFullYear()),e||(null==e?this.view.date.getMonth():r.getMonth()),i||(null==i?this.view.date.getDate():r.getDate()),a||(null==a?this.view.date.getHours():0),n||(null==n?this.view.date.getMinutes():0),s||(null==s?this.view.date.getSeconds():0)),this.view.date=new Date(this.select.getTime()),this.e.value=this.convertDate(this.select,o.join(" ")),this.e.setAttribute("data-value",this.select.getTime()),this.switchView("days"),this.trigger("change")},selectTime:function(t,e,i){return this.selectDate(void 0,void 0,void 0,t,e,i)},open:function(){if(!d(this.dt,"calendar-close"))return this;var e=this,i=this.dt.style;return i.opacity=this.con.animate?0:1,i.display="block",a(n(this.dt,"calendar-close"),"calender-idle"),!d(this.dt,"calendar-static")&&this.calcPosition(),function t(){if(1<=(i.opacity=parseFloat(i.opacity)+.125))return a(n(e.dt,"calendar-idle"),"calendar-open"),e.trigger("open");setTimeout(t,20)}(),this},close:function(){if(!d(this.dt,"calendar-open"))return this;var e=this,i=this.dt.style;return a(n(this.dt,"calendar-open"),"calender-idle"),i.opacity=this.con.animate?1:0,i.display="block",function t(){if((i.opacity-=.125)<=0)return a(n(e.dt,"calendar-idle"),"calendar-close"),i.display="none",e.trigger("close");setTimeout(t,20)}(),this},toggle:function(){return d(this.dt,"calendar-open")?this.close():d(this.dt,"calendar-close")?this.open():this},on:function(t,e,i){return!(["open","close","change","view"].indexOf(t)<0||"function"!=typeof e)&&(t in this.events||(this.events[t]=[]),this.events[t].push({cb:e,args:i instanceof Array?i:[]}),this)},remove:function(){return this.e.removeAttribute("data-tail-datetime"),this.e.removeAttribute("data-value"),this.dt.parentElement.removeChild(this.dt),this},reload:function(){return this.remove(),this.init()},config:function(t,e,i){if(t instanceof Object){for(var a in t)this.config(a,t[a],!1);return this.reload(),this.con}return void 0===t?this.con:t in this.con&&(void 0===e?this.con[t]:(this.con[t]=e,!1!==this.rebuild&&this.reload(),this))}},p});
/* pytesNET/tail.DateTime v.0.4.13 | Basic Version | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t,t.document)}):"object"==typeof module&&module.exports?module.exports=e(t,t.document):(void 0===t.tail&&(t.tail={}),t.tail.DateTime=t.tail.datetime=e(t,t.document),"undefined"!=typeof jQuery&&(jQuery.fn.DateTime=jQuery.fn.datetime=function(t){var e,i=[];return this.each(function(){!1!==(e=tail.DateTime(this,t))&&i.push(e)}),1===i.length?i[0]:0!==i.length&&i}),"undefined"!=typeof MooTools&&(Element.implement({DateTime:function(t){return new tail.DateTime(this,t)}}),Element.implement({datetime:function(t){return new tail.DateTime(this,t)}})))}(window,function(h,d){"use strict";function u(t,e){return!!(t&&"classList"in t)&&t.classList.contains(e)}function a(t,e){return t&&"classList"in t?t.classList.add(e):void 0}function n(t,e){return t&&"classList"in t?t.classList.remove(e):void 0}function s(t,e,i){if(CustomEvent&&CustomEvent.name)var a=new CustomEvent(e,i);else(a=d.createEvent("CustomEvent")).initCustomEvent(e,!!i.bubbles,!!i.cancelable,i.detail);return t.dispatchEvent(a)}function o(t,e){if("function"==typeof Object.assign)return Object.assign({},t,e||{});var i=Object.constructor();for(var a in t)i[a]=a in e?e[a]:t[a];return i}function p(t,e){var i=d.createElement(t);return i.className=e&&e.join?e.join(" "):e||"",i}function v(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,i){var a=t instanceof Date?t:!!t&&new Date(t);return a instanceof Date&&!isNaN(a.getDate())&&(i&&a.setHours(0,0,0,0),!0===e?a.getTime():a)}d.forms.inputmode=!0;var l=function(t,e){if((t="string"==typeof t?d.querySelectorAll(t):t)instanceof NodeList||t instanceof HTMLCollection||t instanceof Array){for(var i=[],a=t.length,n=0;n<a;n++)i.push(new l(t[n],e));return 1===i.length?i[0]:0!==i.length&&i}if(!(t instanceof Element))return!1;if(!(this instanceof l))return new l(t,e);if(l.inst[t.getAttribute("data-tail-datetime")])return l.inst[t.getAttribute("data-tail-datetime")];if(t.getAttribute("data-datetime")){var s=JSON.parse(t.getAttribute("data-datetime").replace(/\'/g,'"'));s instanceof Object&&(e=o(e,s))}return this.e=t,this.id=++l.count,this.con=o(l.defaults,e),(l.inst["tail-"+this.id]=this).e.setAttribute("data-tail-datetime","tail-"+this.id),this.init()};return l.version="0.4.13",l.status="beta",l.count=0,l.inst={},l.defaults={animate:!0,classNames:!1,closeButton:!0,dateFormat:"YYYY-mm-dd",dateStart:!1,dateRanges:[],dateBlacklist:!0,dateEnd:!1,locale:"en",position:"bottom",rtl:"auto",startOpen:!1,stayOpen:!1,time12h:!1,timeFormat:"HH:ii:ss",timeHours:!0,timeMinutes:!0,timeSeconds:0,timeIncrement:!0,timeStepHours:1,timeStepMinutes:5,timeStepSeconds:5,today:!0,tooltips:[],viewDefault:"days",viewDecades:!0,viewYears:!0,viewMonths:!0,viewDays:!0,weekStart:0},l.strings={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorts:["SUN","MON","TUE","WED","THU","FRI","SAT"],time:["Hours","Minutes","Seconds"],header:["Select a Month","Select a Year","Select a Decade","Select a Time"]},modify:function(t,e,i){if(!(t in this))return!1;if(e instanceof Object)for(var a in e)this.modify(t,a,e[a]);else this[t][e]="string"==typeof i?i:this[t][e];return!0},register:function(t,e){return"string"==typeof t&&e instanceof Object&&(this[t]=e,!0)}},l.prototype={init:function(){this.prepare();var t=this.__.shorts.slice(this.con.weekStart).concat(this.__.shorts.slice(0,this.con.weekStart));this.weekdays="<thead>\n<tr>\n";for(var e=0;e<7;e++)this.weekdays+='<th class="calendar-week">'+t[e]+"</th>";this.weekdays+="\n</tr>\n</thead>",this.select=c(this.e.getAttribute("data-value")||this.e.value),(!this.select||this.select<this.con.dateStart||this.select>this.con.dateEnd)&&(this.select=null),null==this.view&&(this.view={type:this.con.viewDefault,date:this.select||new Date});var i=["Hours","Minutes","Seconds"];for(e=0;e<3;e++)if("number"==typeof this.con["time"+i[e]])this.view.date["set"+i[e]](this.con["time"+i[e]]);else for(;this.view.date["get"+i[e]]()%this.con["timeStep"+i[e]]!=0;)this.view.date["set"+i[e]](this.view.date["get"+i[e]]()+1);return this.ampm=12<this.view.date.getHours(),this.events={},this.dt=this.renderCalendar(),this.con.startOpen&&this.open(),this.select&&this.selectDate(this.select),this.bind()},prepare:function(){if(this.__=o(l.strings.en,l.strings[this.con.locale]||{}),this.con.dateStart=c(this.con.dateStart,!0,!0)||-9999999999999,this.con.dateEnd=c(this.con.dateEnd,!0,!0)||9999999999999,this.con.viewDefault=this.con.dateFormat?this.con.viewDefault:"time","string"==typeof this.con.weekStart&&(this.con.weekStart=l.strings.en.shorts.indexOf(this.con.weekStart)),this.con.weekStart<0&&6<this.con.weekStart&&(this.con.weekStart=0),0<this.con.dateRanges.length){for(var t=[],e=(n=this.con.dateRanges).length,i=0;i<e;i++)n[i]instanceof Object&&(n[i].start||n[i].days)&&(!1===(n[i].start=c(n[i].start||!1,!0,!0))?n[i].start=n[i].end=1/0:(!1===(n[i].end=c(n[i].end||!1,!0,!0))&&(n[i].end=n[i].start),n[i].start=n[i].start>n[i].end?[n[i].end,n[i].end=n[i].start][0]:n[i].start),n[i].days=!("days"in n[i])||n[i].days,n[i].days="boolean"!=typeof n[i].days?function(t){for(var e=[],i=t.length,a=0;a<i;a++)"string"==typeof t[a]&&(t[a]=l.strings.en.shorts.indexOf(t[a])),0<=t[a]&&t[a]<=6&&e.push(t[a]);return e}(n[i].days instanceof Array?n[i].days:[n[i].days]):[0,1,2,3,4,5,6],t.push({start:n[i].start,end:n[i].end,days:n[i].days}));this.con.dateRanges=t}if(0<this.con.tooltips.length){t=[];var a,n,s=this.con.tooltips;for(e=s.length,i=0;i<e;i++)s[i]instanceof Object&&s[i].date&&(s[i].date instanceof Array?(a=c(s[i].date[0]||!1,!0,!0),n=c(s[i].date[1]||!1,!0,!0)||a):a=n=c(s[i].date||!1,!0,!0),a&&t.push({date:a!==n?[a,n]:a,text:s[i].text||"Tooltip",color:s[i].color||"inherit",element:s[i].element||(r=d.createElement("DIV"),r.className="calendar-tooltip",r.innerHTML='<div class="tooltip-inner">'+s[i].text||"Tooltip</div>",r)}));this.con.tooltips=t}var r;return this},bind:function(){var e=this;return void 0===this._bind&&(this.e.addEventListener("focusin",function(t){e.open.call(e)}),this.e.addEventListener("keyup",function(t){e.callback.call(e,t)}),d.addEventListener("keyup",function(t){e.dt.contains(t.target)&&e.callback.call(e,t)}),d.addEventListener("click",function(t){e.dt.contains(t.target)?e.callback.call(e,t):!e.e.contains(t.target)&&u(e.dt,"calendar-open")&&(t.target==e.dt||t.target==e.e||e.con.stayOpen||e.close.call(e))}),d.addEventListener("mouseover",function(t){e.dt.contains(t.target)&&e.callback.call(e,t)}),this._bind=!0),this},callback:function(t){var e,i=t.target,a="getAttribute",n="data-action",s=i[a](n)?i:i.parentElement[a](n)?i.parentElement:i,r="data-tooltip";if("mouseover"==t.type&&(!1!==(e=i[a](r)?i:!!s[a](r)&&s)?this.dt.querySelector("#tooltip-"+e[a](r)+"-"+e[a](r+"-time"))||this.showTooltip(e[a](r),e,e[a](r+"-time")):this.dt.querySelector(".calendar-tooltip:not(.remove)")&&this.hideTooltip(this.dt.querySelector(".calendar-tooltip").id.slice(8))),"click"==t.type){if(!s||1!=t.buttons&&1!=(t.which||t.button))return;if(s.hasAttribute("data-disabled"))return;switch(s[a](n)){case"prev":case"next":return this.browseView(s[a](n));case"cancel":this.con.stayOpen||this.close();break;case"submit":return this.con.stayOpen||this.close(),this.selectDate(this.fetchDate(parseInt(s[a]("data-date"))));case"view":return this.switchDate(s[a]("data-year")||null,s[a]("data-month")||null,s[a]("data-day")||null),this.switchView(s[a]("data-view"))}}if("keyup"==t.type){if("INPUT"!=t.target.tagName&&t.target!==this.e&&/calendar-(static|close)/i.test(this.dt.className))return!1;13==(t.keyCode||t.which)&&(this.selectDate(this.fetchDate(this.select)),t.stopPropagation(),this.con.stayOpen||this.close()),27==(t.keyCode||t.which)&&(this.con.stayOpen||this.close())}},trigger:function(t){var e={bubbles:!1,cancelable:!0,detail:{args:arguments,self:this}};"change"==t&&(s(this.e,"input",e),s(this.e,"change",e)),s(this.dt,"tail::"+t,e);for(var i=(this.events[t]||[]).length,a=0;a<i;a++)this.events[t][a].cb.apply(this,function(t,e,i){for(var a=e.length,n=0;n<a;++n)t[n-1]=e[n];return t[n]=i,t}(new Array(arguments.length),arguments,this.events[t][a].args));return!0},calcPosition:function(){var t=this.dt.style,e=h.getComputedStyle(this.dt),i=parseInt(e.marginLeft)+parseInt(e.marginRight),a=parseInt(e.marginTop)+parseInt(e.marginBottom),n=this.e.getBoundingClientRect().top+h.scrollY,s=this.e.getBoundingClientRect().left-h.scrollX,r=this.e.offsetWidth||0,o=this.e.offsetHeight||0;switch(t.visibility="hidden",this.con.position){case"top":var c=n-(this.dt.offsetHeight+a),l=s+r/2-(this.dt.offsetWidth/2+i/2);break;case"left":c=n+o/2-(this.dt.offsetHeight/2+a),l=s-(this.dt.offsetWidth+i);break;case"right":c=n+o/2-(this.dt.offsetHeight/2+a),l=s+r;break;default:c=n+o,l=s+r/2-(this.dt.offsetWidth/2+i/2)}return t.top=(0<=c?c:this.e.offsetTop)+"px",t.left=(0<=l?l:0)+"px",t.visibility="visible",this},convertDate:function(t,e){var i,a={H:String("00"+t.getHours()).toString().slice(-2),G:(i=t.getHours(),i%12?i%12:12),A:12<=t.getHours()?"PM":"AM",a:12<=t.getHours()?"pm":"am",i:String("00"+t.getMinutes()).toString().slice(-2),s:String("00"+t.getSeconds()).toString().slice(-2),Y:t.getFullYear(),y:parseInt(t.getFullYear().toString().slice(2)),m:String("00"+(t.getMonth()+1)).toString().slice(-2),M:this.__.months[t.getMonth()].slice(0,3),F:this.__.months[t.getMonth()],d:String("00"+t.getDate()).toString().slice(-2),D:this.__.days[t.getDay()],l:this.__.shorts[t.getDay()].toLowerCase()};return e.replace(/([HGismd]{1,2}|[Y]{2,4}|y{2})/g,function(t){return 4==t.length||2==t.length?a[t.slice(-1)].toString().slice(-Math.abs(t.length)):1==t.length&&"0"==t[0]?a[t.slice(-1)].toString().slice(-1):a[t.slice(-1)].toString()}).replace(/(A|a|M|F|D|l)/g,function(t){return a[t]})},renderCalendar:function(){var t=["tail-datetime-calendar","calendar-close"],e=!0===this.con.classNames?this.e.className.split(" "):this.con.classNames;if(["top","left","right","bottom"].indexOf(this.con.position)<0){var i=d.querySelector(this.con.position);t.push("calendar-static")}(!0===this.con.rtl||0<=["ar","he","mdr","sam","syr"].indexOf(this.con.rtl))&&t.push("rtl"),this.con.stayOpen&&t.push("calendar-stay"),(e="function"==typeof e.split?e.split(" "):e)instanceof Array&&(t=t.concat(e));var a=p("DIV",t),n=!1;if(a.id="tail-datetime-"+this.id,this.con.dateFormat?n='<span class="action action-prev" data-action="prev"></span><span class="label" data-action="view" data-view="up"></span><span class="action action-next" data-action="next"></span>':this.con.timeFormat&&(n='<span class="action action-submit" data-action="submit"></span><span class="label"></span><span class="action action-cancel" data-action="cancel"></span>'),a.innerHTML=n?'<div class="calendar-actions">'+n+"</div>":"",this.con.dateFormat&&this.renderDatePicker(a,this.con.viewDefault),this.con.timeFormat&&this.renderTimePicker(a),this.con.closeButton&&!i){var s=p("BUTTON","calendar-close"),r=this;s.addEventListener("click",function(t){t.preventDefault(),r.close()}),a.appendChild(s)}return(i||d.body).appendChild(a),a},renderDatePicker:function(t,e){if((!e||["decades","years","months","days"].indexOf(e)<0)&&(e=this.con.viewDays?"days":this.con.viewMonths?"months":this.con.viewYears?"years":!!this.con.viewDecades&&"decades"),!e||!this.con["view"+v(e)]||!this.con.dateFormat)return!1;var i=d.createElement("DIV");return i.className="calendar-datepicker calendar-view-"+e,i.innerHTML=this["view"+v(e)](),t.querySelector(".calendar-datepicker")?t.replaceChild(i,t.querySelector(".calendar-datepicker")):t.appendChild(i),this.view.type=e,this.handleLabel(t)},renderTimePicker:function(t){if(!this.con.timeFormat)return!1;var e,i,a=[],n=0;if(this.con.time12h){var s=12<this.view.date.getHours()?'checked="checked" ':"";a.push('<label class="timepicker-switch" data-am="AM" data-pm="PM"><input type="checkbox" value="1" data-input="PM" '+s+"/><span></span></label>")}for(var r in{Hours:0,Minutes:0,Seconds:0})!1!==this.con["time"+r]?((e=d.createElement("INPUT")).type="text",e.disabled=null===this.con["time"+r],e.setAttribute("min","Hours"===r&&this.con.time12h?"01":"00"),e.setAttribute("max","Hours"!==r?"60":this.con.time12h?"13":"24"),e.setAttribute("step",this.con["timeStep"+r]),e.setAttribute("value",(i=this.view.date["get"+r]())<10?"0"+i:i),e.setAttribute("pattern","d*"),e.setAttribute("inputmode","numeric"),e.setAttribute("data-input",r.toLowerCase()),a.push('<div class="timepicker-field timepicker-'+r.toLowerCase()+'">'+e.outerHTML+'<button class="picker-step step-up"></button><button class="picker-step step-down"></button><label>'+this.__.time[n++]+"</label></div>")):a.push((n++,null));var o=p("DIV","calendar-timepicker"),c=this;o.innerHTML=a.join("\n");var l=o.querySelectorAll("input");for(n=0;n<l.length;n++)"checkbox"!==l[n].type?(l[n].addEventListener("input",function(t){c.handleTime.call(c,this)}),l[n].addEventListener("keydown",function(t){var e=event.keyCode||event.which||0;if(38===e||40===e)return t.preventDefault(),c.handleStep.call(c,this,38===e?"up":"down"),!1})):l[n].addEventListener("change",function(t){c.handleTime.call(c,this)});for(l=o.querySelectorAll("button"),n=0;n<l.length;n++)l[n].addEventListener("mousedown",function(t){t.preventDefault();var e=this.parentElement.querySelector("input");return c.handleStep.call(c,e,u(this,"step-up")?"up":"down"),!1});var h=t.querySelector(".calendar-timepicker");return t[h?"replaceChild":"appendChild"](o,h),this.handleLabel(t)},handleTime:function(t){this.con.time12h&&"checkbox"===t.type&&(this.ampm=t.checked);var e=t.parentElement.parentElement;e=[e.querySelector("input[data-input=hours]")||{value:0},e.querySelector("input[data-input=minutes]")||{value:0},e.querySelector("input[data-input=seconds]")||{value:0}],this.selectTime(parseInt(e[0].value)+(this.ampm?12:0),parseInt(e[1].value),parseInt(e[2].value)),e[2].value=this.view.date.getSeconds(),e[1].value=this.view.date.getMinutes(),this.con.time12h?e[0].value=12<this.view.date.getHours()?this.view.date.getHours()-12:this.view.date.getHours():e[0].value=this.view.date.getHours()},handleStep:function(t,e,i){var a=!1,n=t.getAttribute("data-input"),s=this.con["timeStep"+v(n)],r=parseInt(t.value),o="hours"!==n?60:this.con.time12h?13:24;if("up"===e&&o<=r+s?(a=this.con.timeIncrement&&60==o,t.value=13==o?1:0,this.ampm=12<=this.view.date.getHours()+1):"down"===e&&r-s<(13==o?1:0)?(a=this.con.timeIncrement&&60==o,t.value=o-s,this.ampm=this.view.date.getHours()-1<=0):t.value="up"===e?r+s:r-s,t.value<10&&(t.value="0"+t.value),a){var c=t.parentElement.previousElementSibling.querySelector("input");c&&!1===c.disabled&&this.handleStep(c,e,!0)}if(void 0!==i&&!0===i)return!1;var l=t.parentElement.parentElement;if(this.selectTime(parseInt((l.querySelector("input[data-input=hours]")||{value:0}).value)+(this.ampm?12:0),parseInt((l.querySelector("input[data-input=minutes]")||{value:0}).value),parseInt((l.querySelector("input[data-input=seconds]")||{value:0}).value)),this.con.time12h){var h=t.parentElement.parentElement.querySelector("input[type=checkbox]");h&&h.checked!==12<this.view.date.getHours()&&(h.checked=12<this.view.date.getHours())}return!0},handleLabel:function(t){var e,i,a=t.querySelector(".label");switch(this.view.type){case"days":e=this.__.months[this.view.date.getMonth()]+", "+this.view.date.getFullYear();break;case"months":e=this.view.date.getFullYear();break;case"years":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,3)+"0"))+" - "+(i+10);break;case"decades":e=(i=parseInt(this.view.date.getFullYear().toString().slice(0,2)+"00"))+" - "+(i+100);break;case"time":e=this.__.header[3]}return a.innerText=e,t},viewDecades:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-30);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-decade"+(i>=e.getYear()&&i<=e.getYear()+10?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+" - "+(e.getFullYear()+10)+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+10);return'<table class="calendar-decades"><thead><tr><th colspan="4">'+this.__.header[2]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewYears:function(){var t=this.view.date.getFullYear(),e=new Date(this.view.date.getTime()),i=this.con.today?(new Date).getYear():0;e.setFullYear(t-parseInt(t.toString()[3])-2);for(var a,n,s=[],r=[],o=1;o<=16;o++)a="calendar-year"+(e.getYear()==i?" date-today":""),n='data-action="view" data-view="down" data-year="'+e.getFullYear()+'"',s.push('<td class="'+a+'" '+n+'><span class="inner">'+e.getFullYear()+"</span></td>"),4<=o&&o%4==0&&(r.push("<tr>\n"+s.join("\n")+"\n</tr>"),s=[]),e.setFullYear(e.getFullYear()+1);return'<table class="calendar-years"><thead><tr><th colspan="4">'+this.__.header[1]+"</th></tr></thead><tbody>"+r.join("\n")+"</tbody></table>"},viewMonths:function(){var t=this.__.months,e=this.con.today?(new Date).getMonth():-1;e=this.view.date.getYear()==(new Date).getYear()?e:-1;for(var i,a,n=[],s=[],r=0;r<12;r++)i="calendar-month"+(e==r?" date-today":""),a='data-action="view" data-view="down" data-month="'+r+'"',n.push('<td class="'+i+'" '+a+'><span class="inner">'+t[r]+"</span></td>"),3==n.length&&(s.push("<tr>\n"+n.join("\n")+"\n</tr>"),n=[]);return'<table class="calendar-months"><thead><tr><th colspan="3">'+this.__.header[0]+"</th></tr></thead><tbody>"+s.join("\n")+"</tbody></table>"},viewDays:function(){var i,t,e,a,n,s=new Date(this.view.date.getTime()),r=(new Date).toDateString(),o=s.getMonth(),c=[],l=[],h=[0,[]],d=[].concat(this.con.dateRanges),u=([].concat(this.con.tooltips),[0,0]);for(s.setHours(0,0,0,0),s.setDate(1),s.setDate(1-(s.getDay()-this.con.weekStart));l.length<6;)i=s.getTime(),e='data-action="submit" data-date="'+s.getTime()+'"',t="calendar-day date-"+(s.getMonth()>o?"next":s.getMonth()<o?"previous":"current"),this.con.today&&r==s.toDateString()&&(t+=" date-today"),this.con.dateBlacklist&&(i<this.con.dateStart||i>this.con.dateEnd)?h=[i<this.con.dateStart?this.con.dateStart:1/0,[0,1,2,3,4,5,6],!0]:0==h[0]?d=d.filter(function(t){return t.start==1/0||i>=t.start&&i<=t.end?!(h=[t.end,t.days]):t.start>i},this):3==h.length&&(h=[0,[0,1,2,3,4,5,6]]),0<this.con.tooltips.length&&this.con.tooltips.filter(function(t,e){t.date instanceof Array?t.date[0]<=i&&t.date[1]>=i&&(u=[t.date[1],e,t.color]):t.date==i&&(u=[t.date,e,t.color])},this),u[0]<i&&(u=[0,0]),(n=h[0]>=i&&0<=h[1].indexOf(s.getDay()))&&this.con.dateBlacklist||!n&&!this.con.dateBlacklist?(t+=" date-disabled",e+=' data-disabled="true"'):0!==h[0]&&h[0]<=i&&(h=[0,[]]),this.select&&this.select.toDateString()==s.toDateString()&&(t+=" date-select"),a='<span class="inner">'+s.getDate()+"</span>",0<u[0]&&(t+=" date-tooltip",e+=' data-tooltip="'+u[1]+'" data-tooltip-time="'+i+'"',"inherit"!==u[2]?a+='<span class="tooltip-tick" style="background:'+u[2]+';"></span>':a+='<span class="tooltip-tick"></span>'),c.push('<td class="'+t+'" '+e+">"+a+"</td>"),7==c.length&&(l.push("<tr>\n"+c.join("\n")+"\n</tr>"),c=[]),s.setDate(s.getDate()+1);return l="<tbody>"+l.join("\n")+"</tbody>",'<table class="calendar-days">'+this.weekdays+l+"</table>"},showTooltip:function(t,e,i){var a,n=this.con.tooltips[t].element,s=n.style,r=this.dt.querySelector(".calendar-datepicker");s.cssText="opacity:0;visibility:hidden;",n.id="tooltip-"+t+"-"+i,r.appendChild(n),a=n.offsetWidth,n.offsetHeight,s.top=e.offsetTop+e.offsetHeight+"px",s.left=e.offsetLeft+e.offsetWidth/2-a/2+"px",s.visibility="visible",this.con.animate?(n.setAttribute("data-top",parseInt(s.top)),s.top=parseInt(s.top)+5+"px",function t(){parseFloat(s.top)>n.getAttribute("data-top")&&(s.top=parseFloat(s.top)-.5+"px"),(s.opacity=parseFloat(s.opacity)+.125)<1&&setTimeout(t,20)}()):s.opacity=1},hideTooltip:function(t){var e=this.dt.querySelector("#tooltip-"+t),i=e.style;this.con.animate?(e.className+=" remove",function t(){if(parseFloat(i.top)<parseInt(e.getAttribute("data-top"))+5&&(i.top=parseFloat(i.top)+.5+"px"),(i.opacity-=.125)<0)return(e.className="calendar-tooltip")?e.parentElement.removeChild(e):"";setTimeout(t,20)}()):e.parentElement.removeChild(e)},switchView:function(t){var e=[null,"days","months","years","decades",null];return-1==e.indexOf(t)&&("up"==t?t=e[(e.indexOf(this.view.type)||5)+1]||null:"down"==t&&(t=e[(e.indexOf(this.view.type)||1)-1]||null),t&&this.con["view"+v(t)]||(t=!1)),!!t&&(this.renderDatePicker(this.dt,t),this.trigger("view",t))},switchDate:function(t,e,i,a){if(this.view.date.setFullYear(null==t?this.view.date.getFullYear():t),this.view.date.setMonth(null==e?this.view.date.getMonth():e),"auto"==i){var n=this.view.date,s=new Date;i=n.getMonth()==s.getMonth()&&n.getYear()==s.getYear()?s.getDate():1}return this.view.date.setDate(i||this.view.date.getDate()),!0===a||this.switchView(this.view.type)},switchMonth:function(t,e){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getMonth()+type),this.switchDate(e||this.getFullYear(),t)},switchYear:function(t){return"string"==typeof t&&(t=0<=["previous","prev"].indexOf(t)?-1:1,t=this.view.date.getFullYear()+type),this.switchDate(t)},browseView:function(t){switch(t=0<=["previous","prev"].indexOf(t)?-1:1,this.view.type){case"days":return this.switchDate(null,this.view.date.getMonth()+t,"auto");case"months":return this.switchDate(this.view.date.getFullYear()+t,null,"auto");case"years":return this.switchDate(this.view.date.getFullYear()+10*t,null,"auto");case"decades":return this.switchDate(this.view.date.getFullYear()+100*t,null,"auto")}return!1},fetchDate:function(t){t=c(t||!1)||this.view.date;var e=this.dt.querySelectorAll("input[type=number]");return e&&3==e.length&&t.setHours(e[0].value||0,e[1].value||0,e[2].value||0,0),t},selectDate:function(t,e,i,a,n,s){var r=new Date,o=[];return this.con.dateFormat&&o.push(this.con.dateFormat),this.con.timeFormat&&o.push(this.con.timeFormat),this.select=t instanceof Date?t:new Date(t||(null==t?this.view.date.getFullYear():r.getFullYear()),e||(null==e?this.view.date.getMonth():r.getMonth()),i||(null==i?this.view.date.getDate():r.getDate()),a||(null==a?this.view.date.getHours():0),n||(null==n?this.view.date.getMinutes():0),s||(null==s?this.view.date.getSeconds():0)),this.view.date=new Date(this.select.getTime()),this.e.value=this.convertDate(this.select,o.join(" ")),this.e.setAttribute("data-value",this.select.getTime()),this.switchView("days"),this.trigger("change")},selectTime:function(t,e,i){return this.selectDate(void 0,void 0,void 0,t,e,i)},open:function(){if(!u(this.dt,"calendar-close"))return this;var e=this,i=this.dt.style;return i.display="block",i.opacity=this.con.animate?0:1,n(this.dt,"calendar-close"),a(this.dt,"calendar-idle"),u(this.dt,"calendar-static")||e.calcPosition(),function t(){if(1<=(i.opacity=parseFloat(i.opacity)+.125))return n(e.dt,"calendar-idle"),a(e.dt,"calendar-open"),e.trigger("open");setTimeout(t,20)}(),this},close:function(){if(!u(this.dt,"calendar-open"))return this;var e=this,i=this.dt.style;return i.display="block",i.opacity=this.con.animate?1:0,n(this.dt,"calendar-open"),a(this.dt,"calendar-idle"),function t(){if((i.opacity-=.125)<=0)return n(e.dt,"calendar-idle"),a(e.dt,"calendar-close"),i.display="none",e.trigger("close");setTimeout(t,20)}(),this},toggle:function(){return u(this.dt,"calendar-open")?this.close():u(this.dt,"calendar-close")?this.open():this},on:function(t,e,i){return!(["open","close","change","view"].indexOf(t)<0||"function"!=typeof e)&&(t in this.events||(this.events[t]=[]),this.events[t].push({cb:e,args:i instanceof Array?i:[]}),this)},remove:function(){return this.e.removeAttribute("data-tail-datetime"),this.e.removeAttribute("data-value"),this.dt.parentElement.removeChild(this.dt),this},reload:function(){return this.remove(),this.init()},config:function(t,e,i){if(t instanceof Object){for(var a in t)this.config(a,t[a],!1);return this.reload(),this.con}return void 0===t?this.con:t in this.con&&(void 0===e?this.con[t]:(this.con[t]=e,!1!==this.rebuild&&this.reload(),this))}},l});
/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-all.js

@@ -35,2 +35,14 @@ | @author SamBrishes <sam@pytes.net>

/*
| Translator: Milan Kyncl - (https://github.com/milankyncl)
| GitHub: https://github.com/pytesNET/tail.DateTime/pull/39
*/
datetime.strings.register("cs", {
months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"],
shorts: ["NE", "PO", "ÚT", "ST", "ČT", "PÁ", "SO"],
time: ["Hodiny", "Minuty", "Sekundy"],
header: ["Vyberte měsíc", "Vyberte rok", "Vyberte desetiletí", "Vyberte čas"]
});
/*
| Translator: SamBrishes - (https://www.pytes.net)

@@ -60,2 +72,14 @@ | GitHub: <internal>

/*
| Translator: Tsakal - (https://github.com/tsakal)
| GitHub: https://github.com/pytesNET/tail.DateTime/issues/41
*/
datetime.strings.register("el", {
months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"],
shorts: ["ΚΥΡ", "ΔΕΥ", "ΤΡΙ", "ΤΕΤ", "ΠΕΜ", "ΠΑΡ", "ΣΑΒ"],
time: ["Ώρες", "Λεπτά", "Δευτερόλεπτα"],
header: ["Επιλογή Μηνός", "Επιλογή Έτους", "Επιλογή Δεκαετίας", "Επιλογή Ώρας"]
});
/*
| Translator: SamBrishes - (https://www.pytes.net)

@@ -73,2 +97,14 @@ | GitHub: <internal>

/*
| Translator: elPesecillo - (https://github.com/elPesecillo)
| GitHub: https://github.com/pytesNET/tail.DateTime/issues/34
*/
datetime.strings.register("es_MX", {
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
shorts: ["DO", "LU", "MA", "MI", "JU", "VI", "SÁ"],
time: ["Horas", "Minutos", "Segundos"],
header: ["Selecciona un Mes", "Selecciona un Año", "Selecciona una Decada", "Selecciona la Hora"]
});
/*
| Translator: noxludio - (https://github.com/noxludio)

@@ -111,3 +147,3 @@ | GitHub: https://github.com/pytesNET/tail.DateTime/pull/17

| Translator: Mickeybyte - (https://github.com/mickeybyte)
| GitHub: <internal>
| GitHub: https://github.com/pytesNET/tail.DateTime/issues/15
*/

@@ -135,2 +171,14 @@ datetime.strings.register("nl", {

/*
| Translator: Jacob273 - (https://github.com/Jacob273)
| GitHub: https://github.com/pytesNET/tail.DateTime/pull/32
*/
datetime.strings.register("pl", {
months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
shorts: ["ND", "PN", "WT", "ŚR", "CZW", "PT", "SOB"],
time: ["Godzina", "Minuta", "Sekunda"],
header: ["Wybierz miesiąc", "Wybierz rok", "Wybierz dekadę", "Wybierz czas"]
});
/*
| Translator: Júnior Garcia - (https://github.com/juniorgarcia)

@@ -137,0 +185,0 @@ | GitHub: https://github.com/pytesNET/tail.DateTime/issues/13

@@ -1,2 +0,2 @@

/* pytesNET/tail.select v.0.4.12 | Language Packages | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(i){"function"==typeof define&&define.amd?define(function(){return function(e){i(e)}}):void 0!==window.tail&&window.tail.DateTime&&i(window.tail.DateTime)}(function(e){return e.strings.register("ar",{months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],days:["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],shorts:["أحد","إثن","ثلا","أرب","خمي","جمع","سبت"],time:["ساعة","دقيقة","ثانية"],header:["إختر الشهر","إخنر السنة","إختر العقد","إختر الوقت"]}),e.strings.register("de",{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]}),e.strings.register("de_AT",{months:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]}),e.strings.register("es",{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DOM","LUN","MAR","MIÉ","JUE","VIE","SÁB"],time:["Horas","Minutos","Segundos"],header:["Selecciona un mes","Seleccione un año","Seleccione un década","Seleccione una hora"]}),e.strings.register("fi",{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],days:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],shorts:["Su","Ma","Ti","Ke","To","Pe","La"],time:["Tunnit","Minuutit","Sekuntit"],header:["Valitse kuukausi","Valitse vuosi","Valitse vuosikymmen","Valitse aika"]}),e.strings.register("fr",{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shorts:["DIM","LUN","MAR","MER","JEU","VEN","SAM"],time:["Heure","Minute","Seconde"],header:["Choisissez un mois","Choisissez une année","Choisissez une décénie","Kies een Tijdstip"]}),e.strings.register("it",{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shorts:["DOM","LUN","MAR","MER","GIO","VEN","SAB"],time:["Ore","Minuti","Secondi"],header:["Seleziona un mese","Seleziona un anno","Seleziona un decennio","Seleziona un orario"]}),e.strings.register("nl",{months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],shorts:["ZO","MA","DI","WO","DO","VR","ZA"],time:["Uur","Minuten","Seconden"],header:["Kies een Maand","Kies een Jaar","Kies een Decennium","Kies een Tijdstip"]}),e.strings.register("no",{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],shorts:["SØN","MAN","TIR","ONS","TOR","FRE","LØR"],time:["Timer","Minutter","Sekunder"],header:["Velg måned","Velg år","Velg tiår","Velg klokkeslett"]}),e.strings.register("pt_BR",{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shorts:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],time:["Horas","Minutos","Segundos"],header:["Escolha um mês","Escolha um ano","Escolha uma década","Escolha um horário"]}),e.strings.register("ru",{months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shorts:["вс","пн","вт","ср","чт","пт","сб"],time:["часов","минут","секунд"],header:["Выберите месяц","Выберите год","Выберите Десятилетие","Выберите время"]}),e.strings.register("tr",{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shorts:["PA","PT","SA","ÇA","PE","CU","CT"],time:["Saat","Dakika","Saniye"],header:["Ay Seçin","Yıl Seçin","On Yıl Seçin","Zaman Seçin"]}),e});
/* pytesNET/tail.select v.0.4.13 | Language Packages | @author SamBrishes, pytesNET <sam@pytes.net> | @license MIT */
!function(i){"function"==typeof define&&define.amd?define(function(){return function(e){i(e)}}):void 0!==window.tail&&window.tail.DateTime&&i(window.tail.DateTime)}(function(e){return e.strings.register("ar",{months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],days:["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],shorts:["أحد","إثن","ثلا","أرب","خمي","جمع","سبت"],time:["ساعة","دقيقة","ثانية"],header:["إختر الشهر","إخنر السنة","إختر العقد","إختر الوقت"]}),e.strings.register("cs",{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],shorts:["NE","PO","ÚT","ST","ČT","PÁ","SO"],time:["Hodiny","Minuty","Sekundy"],header:["Vyberte měsíc","Vyberte rok","Vyberte desetiletí","Vyberte čas"]}),e.strings.register("de",{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]}),e.strings.register("de_AT",{months:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shorts:["SO","MO","DI","MI","DO","FR","SA"],time:["Stunden","Minuten","Sekunden"],header:["Wähle einen Monat","Wähle ein Jahr","Wähle ein Jahrzehnt","Wähle eine Uhrzeit"]}),e.strings.register("el",{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],days:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],shorts:["ΚΥΡ","ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ"],time:["Ώρες","Λεπτά","Δευτερόλεπτα"],header:["Επιλογή Μηνός","Επιλογή Έτους","Επιλογή Δεκαετίας","Επιλογή Ώρας"]}),e.strings.register("es",{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DOM","LUN","MAR","MIÉ","JUE","VIE","SÁB"],time:["Horas","Minutos","Segundos"],header:["Selecciona un mes","Seleccione un año","Seleccione un década","Seleccione una hora"]}),e.strings.register("es_MX",{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],shorts:["DO","LU","MA","MI","JU","VI","SÁ"],time:["Horas","Minutos","Segundos"],header:["Selecciona un Mes","Selecciona un Año","Selecciona una Decada","Selecciona la Hora"]}),e.strings.register("fi",{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],days:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],shorts:["Su","Ma","Ti","Ke","To","Pe","La"],time:["Tunnit","Minuutit","Sekuntit"],header:["Valitse kuukausi","Valitse vuosi","Valitse vuosikymmen","Valitse aika"]}),e.strings.register("fr",{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],shorts:["DIM","LUN","MAR","MER","JEU","VEN","SAM"],time:["Heure","Minute","Seconde"],header:["Choisissez un mois","Choisissez une année","Choisissez une décénie","Kies een Tijdstip"]}),e.strings.register("it",{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shorts:["DOM","LUN","MAR","MER","GIO","VEN","SAB"],time:["Ore","Minuti","Secondi"],header:["Seleziona un mese","Seleziona un anno","Seleziona un decennio","Seleziona un orario"]}),e.strings.register("nl",{months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],shorts:["ZO","MA","DI","WO","DO","VR","ZA"],time:["Uur","Minuten","Seconden"],header:["Kies een Maand","Kies een Jaar","Kies een Decennium","Kies een Tijdstip"]}),e.strings.register("no",{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],shorts:["SØN","MAN","TIR","ONS","TOR","FRE","LØR"],time:["Timer","Minutter","Sekunder"],header:["Velg måned","Velg år","Velg tiår","Velg klokkeslett"]}),e.strings.register("pl",{months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],shorts:["ND","PN","WT","ŚR","CZW","PT","SOB"],time:["Godzina","Minuta","Sekunda"],header:["Wybierz miesiąc","Wybierz rok","Wybierz dekadę","Wybierz czas"]}),e.strings.register("pt_BR",{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shorts:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],time:["Horas","Minutos","Segundos"],header:["Escolha um mês","Escolha um ano","Escolha uma década","Escolha um horário"]}),e.strings.register("ru",{months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shorts:["вс","пн","вт","ср","чт","пт","сб"],time:["часов","минут","секунд"],header:["Выберите месяц","Выберите год","Выберите Десятилетие","Выберите время"]}),e.strings.register("tr",{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shorts:["PA","PT","SA","ÇA","PE","CU","CT"],time:["Saat","Dakika","Saniye"],header:["Ay Seçin","Yıl Seçin","On Yıl Seçin","Zaman Seçin"]}),e});
/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-ar.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-de_AT.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-de.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-es.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-fi.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-fr.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-it.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-nl.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -13,3 +13,3 @@ | @website https://github.com/pytesNET/tail.DateTime

| Translator: Mickeybyte - (https://github.com/mickeybyte)
| GitHub: <internal>
| GitHub: https://github.com/pytesNET/tail.DateTime/issues/15
*/

@@ -16,0 +16,0 @@ ;(function(factory){

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-no.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-pt_BR.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-ru.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

/*
| tail.datetime - A vanilla JavaScript DateTime Picker without dependencies!
| tail.datetime - The vanilla way to select dates and times!
| @file ./langs/tail.datetime-tr.js
| @author SamBrishes <sam@pytes.net>
| @version 0.4.12 - Beta
| @version 0.4.13 - Beta
|

@@ -7,0 +7,0 @@ | @website https://github.com/pytesNET/tail.DateTime

{
"name": "tail.datetime",
"version": "0.4.12",
"description": "A powerful, translat- and configurable DateTime Picker, written in Vanilla JavaScript without any dependencies!",
"version": "0.4.13",
"description": "A powerful, extensive and configurable Date/Time Picker, written in Vanilla JavaScript without any dependencies!",
"keywords": [

@@ -29,3 +29,4 @@ "datetime-picker",

"devDependencies": {
"less": ">=3.5.0"
"less": ">=3.5.0",
"clean-css": ">=4.1.0"
},

@@ -32,0 +33,0 @@

@@ -9,7 +9,15 @@ tail.DateTime

The **tail.DateTime** package provides an extensive and configurable Date/Time Calendar Picker for
your website, written in vanilla JavaScript and without any dependencies! It was originally a fork
of MrGuiseppes [Pure JS Calendar](https://github.com/MrGuiseppe/pureJSCalendar), but version 0.4.0
broke away from the last original lines and the script is now completely independent!
The perfect Date/Time Picker for your perfect Website / Web-Application!
<p align="center" style="text-align:center"><a href="https://github.pytes.net/tail.DateTime">
<img src="https://repository-images.githubusercontent.com/157055836/51d40e80-9b33-11e9-8fbb-f05ce51a16c4" style="width:auto;max-width:640px;" />
</a></p>
The **tail.DateTime** script is an extensive and fully-featured Date/Time Picker, written in vanilla
JavaScfript and without any dependency. It is compatible with all major browsers, starting with
**IE 10** and above, and is optimized for a direct use in the browser, as AMD (using requireJS) or
as browserify module.
----------------------------
[Wanna see **tail.DateTime** in action?](https://github.pytes.net/tail.DateTime)

@@ -21,3 +29,3 @@

-------
<p align="center" atyle="text-align:center">
<p align="center" style="text-align:center">
You really like my <b>tail.DateTime</b> script and want to support me and all of my projects?<br/>

@@ -30,13 +38,12 @@ Then I would be extremely grateful for a coffee! (<b>Thanks to all Supporters</b>)<br/><br/>

--------
- A beautiful Date/Time Picker (in 2 Designs + 6 Color Schemes).
- Definable ranges of selectable dates (Blacklist / Whitelist).
- Colorable Tooltips with an cute animation.
- Different Views to navigate quickly: Days, Months, Years & Decades.
- Completely Translatable and already available in 9 languages.
- Extendable and Bindable through different Events.
- Many Settings to adapt and configure the design and behaviour.
- Supports AMD (requireJS) and available as browserify module.
- Compatible with all modern browsers **(including IE 10+)**
- No Dependencies, just embed and use
- Free/To/Use - MIT Licensed
- **Beautiful**. 2 different Designs in 4 / 2 color schemes...
- **Extensive**.
- Define Black- or Whitelists...
- Use colorizable tooltips...
- Restrict the date/time selection...
- ... and way more ...
- **Configurable**. 30 settings and 4 bindable events...
- **Translatable**. Already available in 17 languages...
- **Zero Dependencies**. And written in vanilla JavaScript...
- **Free/To/Use**. Because it's MIT licensed <3

@@ -78,4 +85,4 @@ Install & Embed

- [jsCompress](https://jscompress.com/) for the Compressor
- [prismJS](https://prismjs.com) for the Syntax highlighting library
- [MenuSpy](https://github.com/lcdsantos/menuspy) for the Menu Navigation
- [prismJS](https://prismjs.com) for the Syntax highlighting library _[used on the demo]_
- [MenuSpy](https://github.com/lcdsantos/menuspy) for the Menu Navigation _[used on the demo]_

@@ -91,2 +98,6 @@ ### Translations

- [Lars Athle Larsen](https://github.com/larsathle) / [Norwegian Translation](https://github.com/pytesNET/tail.DateTime/pull/31)
- [Jacob273](https://github.com/Jacob273) / [Polish Translation](https://github.com/pytesNET/tail.DateTime/pull/32)
- [elPesecillo](https://github.com/elPesecillo) / [Spanish Mexican Translation](https://github.com/pytesNET/tail.DateTime/issue/34)
- [Milan Kyncl](https://github.com/milankyncl) / [Czech Translation](https://github.com/pytesNET/tail.DateTime/pill/39)
- [tsakal](https://github.com/tsakal) / [Greek Translation](https://github.com/pytesNET/tail.DateTime/issues/41)

@@ -109,3 +120,3 @@ Documentation

just a single selector as `string`, which calls the `querySelectorAll()` method on its own. The
second parameter is optional and, if set, MUST be an object with your *tail.DateTime* options.
second parameter is optional and, if set, MUST be an object with your **tail.DateTime** options.

@@ -142,31 +153,32 @@ ```html

tail.DateTime(".tail-datetime-field", {
animate: true,
classNames: false,
closeButton: true, // New in 0.4.5
dateFormat: "YYYY-mm-dd",
dateStart: false,
dateRanges: [],
dateBlacklist: true,
dateEnd: false,
locale: "en",
position: "bottom",
rtl: "auto",
startOpen: false,
stayOpen: false,
timeFormat: "HH:ii:ss",
timeHours: null, // New Syntax in 0.4.5
timeMinutes: null, // New Syntax in 0.4.5
timeSeconds: 0, // New Syntax in 0.4.5
timeIncrement: true, // New in 0.4.5
timeStepHours: 1, // New in 0.4.3
timeStepMinutes: 5, // New in 0.4.3
timeStepSeconds: 5, // New in 0.4.3
today: true,
tooltips: [],
viewDefault: "days",
viewDecades: true,
viewYears: true,
viewMonths: true,
viewDays: true,
weekStart: 0
animate: true, // [0.4.0] Boolean
classNames: false, // [0.3.0] Boolean, String, Array, null
closeButton: true, // [0.4.5] Boolean
dateFormat: "YYYY-mm-dd", // [0.1.0] String (PHP similar Date)
dateStart: false, // [0.4.0] String, Date, Integer, False
dateRanges: [], // [0.3.0] Array
dateBlacklist: true, // [0.4.0] Boolean
dateEnd: false, // [0.4.0] String, Date, Integer, False
locale: "en", // [0.4.0] String
position: "bottom", // [0.1.0] String
rtl: "auto", // [0.4.1] String, Boolean
startOpen: false, // [0.3.0] Boolean
stayOpen: false, // [0.3.0] Boolean
time12h: false, // [0.4.13][NEW] Boolean
timeFormat: "HH:ii:ss", // [0.1.0] String (PHP similar Date)
timeHours: true, // [0.4.13][UPD] Integer, Boolean, null
timeMinutes: true, // [0.4.13][UPD] Integer, Boolean, null
timeSeconds: 0, // [0.4.13][UPD] Integer, Boolean, null
timeIncrement: true, // [0.4.5] Boolean
timeStepHours: 1, // [0.4.3] Integer
timeStepMinutes: 5, // [0.4.3] Integer
timeStepSeconds: 5, // [0.4.3] Integer
today: true, // [0.4.0] Boolean
tooltips: [], // [0.4.0] Array
viewDefault: "days", // [0.4.0] String
viewDecades: true, // [0.4.0] Boolean
viewYears: true, // [0.4.0] Boolean
viewMonths: true, // [0.4.0] Boolean
viewDays: true, // [0.4.0] Boolean
weekStart: 0 // [0.1.0] String, Integer
});

@@ -173,0 +185,0 @@ ```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc