Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/scripts/ext
File: jquery-ui-timepicker-addon.js
tp_inst._defaults.showTimepicker = false;
[1500] Fix | Delete
tp_inst._updateDateTime(inst);
[1501] Fix | Delete
}
[1502] Fix | Delete
};
[1503] Fix | Delete
[1504] Fix | Delete
$.datepicker._enableTimepickerDatepicker = function (target) {
[1505] Fix | Delete
var inst = this._getInst(target);
[1506] Fix | Delete
if (!inst) {
[1507] Fix | Delete
return;
[1508] Fix | Delete
}
[1509] Fix | Delete
[1510] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1511] Fix | Delete
$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
[1512] Fix | Delete
if (tp_inst) {
[1513] Fix | Delete
inst.settings.showTimepicker = true;
[1514] Fix | Delete
tp_inst._defaults.showTimepicker = true;
[1515] Fix | Delete
tp_inst._addTimePicker(inst); // Could be disabled on page load
[1516] Fix | Delete
tp_inst._updateDateTime(inst);
[1517] Fix | Delete
}
[1518] Fix | Delete
};
[1519] Fix | Delete
[1520] Fix | Delete
/*
[1521] Fix | Delete
* Create our own set time function
[1522] Fix | Delete
*/
[1523] Fix | Delete
$.datepicker._setTime = function (inst, date) {
[1524] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1525] Fix | Delete
if (tp_inst) {
[1526] Fix | Delete
var defaults = tp_inst._defaults;
[1527] Fix | Delete
[1528] Fix | Delete
// calling _setTime with no date sets time to defaults
[1529] Fix | Delete
tp_inst.hour = date ? date.getHours() : defaults.hour;
[1530] Fix | Delete
tp_inst.minute = date ? date.getMinutes() : defaults.minute;
[1531] Fix | Delete
tp_inst.second = date ? date.getSeconds() : defaults.second;
[1532] Fix | Delete
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
[1533] Fix | Delete
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
[1534] Fix | Delete
[1535] Fix | Delete
//check if within min/max times..
[1536] Fix | Delete
tp_inst._limitMinMaxDateTime(inst, true);
[1537] Fix | Delete
[1538] Fix | Delete
tp_inst._onTimeChange();
[1539] Fix | Delete
tp_inst._updateDateTime(inst);
[1540] Fix | Delete
}
[1541] Fix | Delete
};
[1542] Fix | Delete
[1543] Fix | Delete
/*
[1544] Fix | Delete
* Create new public method to set only time, callable as $().datepicker('setTime', date)
[1545] Fix | Delete
*/
[1546] Fix | Delete
$.datepicker._setTimeDatepicker = function (target, date, withDate) {
[1547] Fix | Delete
var inst = this._getInst(target);
[1548] Fix | Delete
if (!inst) {
[1549] Fix | Delete
return;
[1550] Fix | Delete
}
[1551] Fix | Delete
[1552] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1553] Fix | Delete
[1554] Fix | Delete
if (tp_inst) {
[1555] Fix | Delete
this._setDateFromField(inst);
[1556] Fix | Delete
var tp_date;
[1557] Fix | Delete
if (date) {
[1558] Fix | Delete
if (typeof date === "string") {
[1559] Fix | Delete
tp_inst._parseTime(date, withDate);
[1560] Fix | Delete
tp_date = new Date();
[1561] Fix | Delete
tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
[1562] Fix | Delete
tp_date.setMicroseconds(tp_inst.microsec);
[1563] Fix | Delete
} else {
[1564] Fix | Delete
tp_date = new Date(date.getTime());
[1565] Fix | Delete
tp_date.setMicroseconds(date.getMicroseconds());
[1566] Fix | Delete
}
[1567] Fix | Delete
if (tp_date.toString() === 'Invalid Date') {
[1568] Fix | Delete
tp_date = undefined;
[1569] Fix | Delete
}
[1570] Fix | Delete
this._setTime(inst, tp_date);
[1571] Fix | Delete
}
[1572] Fix | Delete
}
[1573] Fix | Delete
[1574] Fix | Delete
};
[1575] Fix | Delete
[1576] Fix | Delete
/*
[1577] Fix | Delete
* override setDate() to allow setting time too within Date object
[1578] Fix | Delete
*/
[1579] Fix | Delete
$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
[1580] Fix | Delete
$.datepicker._setDateDatepicker = function (target, date) {
[1581] Fix | Delete
var inst = this._getInst(target);
[1582] Fix | Delete
if (!inst) {
[1583] Fix | Delete
return;
[1584] Fix | Delete
}
[1585] Fix | Delete
[1586] Fix | Delete
if (typeof(date) === 'string') {
[1587] Fix | Delete
date = new Date(date);
[1588] Fix | Delete
if (!date.getTime()) {
[1589] Fix | Delete
$.timepicker.log("Error creating Date object from string.");
[1590] Fix | Delete
}
[1591] Fix | Delete
}
[1592] Fix | Delete
[1593] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1594] Fix | Delete
var tp_date;
[1595] Fix | Delete
if (date instanceof Date) {
[1596] Fix | Delete
tp_date = new Date(date.getTime());
[1597] Fix | Delete
tp_date.setMicroseconds(date.getMicroseconds());
[1598] Fix | Delete
} else {
[1599] Fix | Delete
tp_date = date;
[1600] Fix | Delete
}
[1601] Fix | Delete
[1602] Fix | Delete
// This is important if you are using the timezone option, javascript's Date
[1603] Fix | Delete
// object will only return the timezone offset for the current locale, so we
[1604] Fix | Delete
// adjust it accordingly. If not using timezone option this won't matter..
[1605] Fix | Delete
// If a timezone is different in tp, keep the timezone as is
[1606] Fix | Delete
if (tp_inst && tp_date) {
[1607] Fix | Delete
// look out for DST if tz wasn't specified
[1608] Fix | Delete
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
[1609] Fix | Delete
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
[1610] Fix | Delete
}
[1611] Fix | Delete
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
[1612] Fix | Delete
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
[1613] Fix | Delete
}
[1614] Fix | Delete
[1615] Fix | Delete
this._updateDatepicker(inst);
[1616] Fix | Delete
this._base_setDateDatepicker.apply(this, arguments);
[1617] Fix | Delete
this._setTimeDatepicker(target, tp_date, true);
[1618] Fix | Delete
};
[1619] Fix | Delete
[1620] Fix | Delete
/*
[1621] Fix | Delete
* override getDate() to allow getting time too within Date object
[1622] Fix | Delete
*/
[1623] Fix | Delete
$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
[1624] Fix | Delete
$.datepicker._getDateDatepicker = function (target, noDefault) {
[1625] Fix | Delete
var inst = this._getInst(target);
[1626] Fix | Delete
if (!inst) {
[1627] Fix | Delete
return;
[1628] Fix | Delete
}
[1629] Fix | Delete
[1630] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1631] Fix | Delete
[1632] Fix | Delete
if (tp_inst) {
[1633] Fix | Delete
// if it hasn't yet been defined, grab from field
[1634] Fix | Delete
if (inst.lastVal === undefined) {
[1635] Fix | Delete
this._setDateFromField(inst, noDefault);
[1636] Fix | Delete
}
[1637] Fix | Delete
[1638] Fix | Delete
var date = this._getDate(inst);
[1639] Fix | Delete
if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
[1640] Fix | Delete
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
[1641] Fix | Delete
date.setMicroseconds(tp_inst.microsec);
[1642] Fix | Delete
[1643] Fix | Delete
// This is important if you are using the timezone option, javascript's Date
[1644] Fix | Delete
// object will only return the timezone offset for the current locale, so we
[1645] Fix | Delete
// adjust it accordingly. If not using timezone option this won't matter..
[1646] Fix | Delete
if (tp_inst.timezone != null) {
[1647] Fix | Delete
// look out for DST if tz wasn't specified
[1648] Fix | Delete
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
[1649] Fix | Delete
tp_inst.timezone = date.getTimezoneOffset() * -1;
[1650] Fix | Delete
}
[1651] Fix | Delete
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
[1652] Fix | Delete
}
[1653] Fix | Delete
}
[1654] Fix | Delete
return date;
[1655] Fix | Delete
}
[1656] Fix | Delete
return this._base_getDateDatepicker(target, noDefault);
[1657] Fix | Delete
};
[1658] Fix | Delete
[1659] Fix | Delete
/*
[1660] Fix | Delete
* override parseDate() because UI 1.8.14 throws an error about "Extra characters"
[1661] Fix | Delete
* An option in datapicker to ignore extra format characters would be nicer.
[1662] Fix | Delete
*/
[1663] Fix | Delete
$.datepicker._base_parseDate = $.datepicker.parseDate;
[1664] Fix | Delete
$.datepicker.parseDate = function (format, value, settings) {
[1665] Fix | Delete
var date;
[1666] Fix | Delete
try {
[1667] Fix | Delete
date = this._base_parseDate(format, value, settings);
[1668] Fix | Delete
} catch (err) {
[1669] Fix | Delete
// Hack! The error message ends with a colon, a space, and
[1670] Fix | Delete
// the "extra" characters. We rely on that instead of
[1671] Fix | Delete
// attempting to perfectly reproduce the parsing algorithm.
[1672] Fix | Delete
if (err.indexOf(":") >= 0) {
[1673] Fix | Delete
date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
[1674] Fix | Delete
$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
[1675] Fix | Delete
} else {
[1676] Fix | Delete
throw err;
[1677] Fix | Delete
}
[1678] Fix | Delete
}
[1679] Fix | Delete
return date;
[1680] Fix | Delete
};
[1681] Fix | Delete
[1682] Fix | Delete
/*
[1683] Fix | Delete
* override formatDate to set date with time to the input
[1684] Fix | Delete
*/
[1685] Fix | Delete
$.datepicker._base_formatDate = $.datepicker._formatDate;
[1686] Fix | Delete
$.datepicker._formatDate = function (inst, day, month, year) {
[1687] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1688] Fix | Delete
if (tp_inst) {
[1689] Fix | Delete
tp_inst._updateDateTime(inst);
[1690] Fix | Delete
return tp_inst.$input.val();
[1691] Fix | Delete
}
[1692] Fix | Delete
return this._base_formatDate(inst);
[1693] Fix | Delete
};
[1694] Fix | Delete
[1695] Fix | Delete
/*
[1696] Fix | Delete
* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
[1697] Fix | Delete
*/
[1698] Fix | Delete
$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
[1699] Fix | Delete
$.datepicker._optionDatepicker = function (target, name, value) {
[1700] Fix | Delete
var inst = this._getInst(target),
[1701] Fix | Delete
name_clone;
[1702] Fix | Delete
if (!inst) {
[1703] Fix | Delete
return null;
[1704] Fix | Delete
}
[1705] Fix | Delete
[1706] Fix | Delete
var tp_inst = this._get(inst, 'timepicker');
[1707] Fix | Delete
if (tp_inst) {
[1708] Fix | Delete
var min = null,
[1709] Fix | Delete
max = null,
[1710] Fix | Delete
onselect = null,
[1711] Fix | Delete
overrides = tp_inst._defaults.evnts,
[1712] Fix | Delete
fns = {},
[1713] Fix | Delete
prop;
[1714] Fix | Delete
if (typeof name === 'string') { // if min/max was set with the string
[1715] Fix | Delete
if (name === 'minDate' || name === 'minDateTime') {
[1716] Fix | Delete
min = value;
[1717] Fix | Delete
} else if (name === 'maxDate' || name === 'maxDateTime') {
[1718] Fix | Delete
max = value;
[1719] Fix | Delete
} else if (name === 'onSelect') {
[1720] Fix | Delete
onselect = value;
[1721] Fix | Delete
} else if (overrides.hasOwnProperty(name)) {
[1722] Fix | Delete
if (typeof (value) === 'undefined') {
[1723] Fix | Delete
return overrides[name];
[1724] Fix | Delete
}
[1725] Fix | Delete
fns[name] = value;
[1726] Fix | Delete
name_clone = {}; //empty results in exiting function after overrides updated
[1727] Fix | Delete
}
[1728] Fix | Delete
} else if (typeof name === 'object') { //if min/max was set with the JSON
[1729] Fix | Delete
if (name.minDate) {
[1730] Fix | Delete
min = name.minDate;
[1731] Fix | Delete
} else if (name.minDateTime) {
[1732] Fix | Delete
min = name.minDateTime;
[1733] Fix | Delete
} else if (name.maxDate) {
[1734] Fix | Delete
max = name.maxDate;
[1735] Fix | Delete
} else if (name.maxDateTime) {
[1736] Fix | Delete
max = name.maxDateTime;
[1737] Fix | Delete
}
[1738] Fix | Delete
for (prop in overrides) {
[1739] Fix | Delete
if (overrides.hasOwnProperty(prop) && name[prop]) {
[1740] Fix | Delete
fns[prop] = name[prop];
[1741] Fix | Delete
}
[1742] Fix | Delete
}
[1743] Fix | Delete
}
[1744] Fix | Delete
for (prop in fns) {
[1745] Fix | Delete
if (fns.hasOwnProperty(prop)) {
[1746] Fix | Delete
overrides[prop] = fns[prop];
[1747] Fix | Delete
if (!name_clone) { name_clone = $.extend({}, name); }
[1748] Fix | Delete
delete name_clone[prop];
[1749] Fix | Delete
}
[1750] Fix | Delete
}
[1751] Fix | Delete
if (name_clone && isEmptyObject(name_clone)) { return; }
[1752] Fix | Delete
if (min) { //if min was set
[1753] Fix | Delete
if (min === 0) {
[1754] Fix | Delete
min = new Date();
[1755] Fix | Delete
} else {
[1756] Fix | Delete
min = new Date(min);
[1757] Fix | Delete
}
[1758] Fix | Delete
tp_inst._defaults.minDate = min;
[1759] Fix | Delete
tp_inst._defaults.minDateTime = min;
[1760] Fix | Delete
} else if (max) { //if max was set
[1761] Fix | Delete
if (max === 0) {
[1762] Fix | Delete
max = new Date();
[1763] Fix | Delete
} else {
[1764] Fix | Delete
max = new Date(max);
[1765] Fix | Delete
}
[1766] Fix | Delete
tp_inst._defaults.maxDate = max;
[1767] Fix | Delete
tp_inst._defaults.maxDateTime = max;
[1768] Fix | Delete
} else if (onselect) {
[1769] Fix | Delete
tp_inst._defaults.onSelect = onselect;
[1770] Fix | Delete
}
[1771] Fix | Delete
}
[1772] Fix | Delete
if (value === undefined) {
[1773] Fix | Delete
return this._base_optionDatepicker.call($.datepicker, target, name);
[1774] Fix | Delete
}
[1775] Fix | Delete
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
[1776] Fix | Delete
};
[1777] Fix | Delete
[1778] Fix | Delete
/*
[1779] Fix | Delete
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
[1780] Fix | Delete
* it will return false for all objects
[1781] Fix | Delete
*/
[1782] Fix | Delete
var isEmptyObject = function (obj) {
[1783] Fix | Delete
var prop;
[1784] Fix | Delete
for (prop in obj) {
[1785] Fix | Delete
if (obj.hasOwnProperty(prop)) {
[1786] Fix | Delete
return false;
[1787] Fix | Delete
}
[1788] Fix | Delete
}
[1789] Fix | Delete
return true;
[1790] Fix | Delete
};
[1791] Fix | Delete
[1792] Fix | Delete
/*
[1793] Fix | Delete
* jQuery extend now ignores nulls!
[1794] Fix | Delete
*/
[1795] Fix | Delete
var extendRemove = function (target, props) {
[1796] Fix | Delete
$.extend(target, props);
[1797] Fix | Delete
for (var name in props) {
[1798] Fix | Delete
if (props[name] === null || props[name] === undefined) {
[1799] Fix | Delete
target[name] = props[name];
[1800] Fix | Delete
}
[1801] Fix | Delete
}
[1802] Fix | Delete
return target;
[1803] Fix | Delete
};
[1804] Fix | Delete
[1805] Fix | Delete
/*
[1806] Fix | Delete
* Determine by the time format which units are supported
[1807] Fix | Delete
* Returns an object of booleans for each unit
[1808] Fix | Delete
*/
[1809] Fix | Delete
var detectSupport = function (timeFormat) {
[1810] Fix | Delete
var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
[1811] Fix | Delete
isIn = function (f, t) { // does the format contain the token?
[1812] Fix | Delete
return f.indexOf(t) !== -1 ? true : false;
[1813] Fix | Delete
};
[1814] Fix | Delete
return {
[1815] Fix | Delete
hour: isIn(tf, 'h'),
[1816] Fix | Delete
minute: isIn(tf, 'm'),
[1817] Fix | Delete
second: isIn(tf, 's'),
[1818] Fix | Delete
millisec: isIn(tf, 'l'),
[1819] Fix | Delete
microsec: isIn(tf, 'c'),
[1820] Fix | Delete
timezone: isIn(tf, 'z'),
[1821] Fix | Delete
ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
[1822] Fix | Delete
iso8601: isIn(timeFormat, 'Z')
[1823] Fix | Delete
};
[1824] Fix | Delete
};
[1825] Fix | Delete
[1826] Fix | Delete
/*
[1827] Fix | Delete
* Converts 24 hour format into 12 hour
[1828] Fix | Delete
* Returns 12 hour without leading 0
[1829] Fix | Delete
*/
[1830] Fix | Delete
var convert24to12 = function (hour) {
[1831] Fix | Delete
hour %= 12;
[1832] Fix | Delete
[1833] Fix | Delete
if (hour === 0) {
[1834] Fix | Delete
hour = 12;
[1835] Fix | Delete
}
[1836] Fix | Delete
[1837] Fix | Delete
return String(hour);
[1838] Fix | Delete
};
[1839] Fix | Delete
[1840] Fix | Delete
var computeEffectiveSetting = function (settings, property) {
[1841] Fix | Delete
return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
[1842] Fix | Delete
};
[1843] Fix | Delete
[1844] Fix | Delete
/*
[1845] Fix | Delete
* Splits datetime string into date and time substrings.
[1846] Fix | Delete
* Throws exception when date can't be parsed
[1847] Fix | Delete
* Returns {dateString: dateString, timeString: timeString}
[1848] Fix | Delete
*/
[1849] Fix | Delete
var splitDateTime = function (dateTimeString, timeSettings) {
[1850] Fix | Delete
// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
[1851] Fix | Delete
// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
[1852] Fix | Delete
var separator = computeEffectiveSetting(timeSettings, 'separator'),
[1853] Fix | Delete
format = computeEffectiveSetting(timeSettings, 'timeFormat'),
[1854] Fix | Delete
timeParts = format.split(separator), // how many occurrences of separator may be in our format?
[1855] Fix | Delete
timePartsLen = timeParts.length,
[1856] Fix | Delete
allParts = dateTimeString.split(separator),
[1857] Fix | Delete
allPartsLen = allParts.length;
[1858] Fix | Delete
[1859] Fix | Delete
if (allPartsLen > 1) {
[1860] Fix | Delete
return {
[1861] Fix | Delete
dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
[1862] Fix | Delete
timeString: allParts.splice(0, timePartsLen).join(separator)
[1863] Fix | Delete
};
[1864] Fix | Delete
}
[1865] Fix | Delete
[1866] Fix | Delete
return {
[1867] Fix | Delete
dateString: dateTimeString,
[1868] Fix | Delete
timeString: ''
[1869] Fix | Delete
};
[1870] Fix | Delete
};
[1871] Fix | Delete
[1872] Fix | Delete
/*
[1873] Fix | Delete
* Internal function to parse datetime interval
[1874] Fix | Delete
* Returns: {date: Date, timeObj: Object}, where
[1875] Fix | Delete
* date - parsed date without time (type Date)
[1876] Fix | Delete
* timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
[1877] Fix | Delete
*/
[1878] Fix | Delete
var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
[1879] Fix | Delete
var date,
[1880] Fix | Delete
parts,
[1881] Fix | Delete
parsedTime;
[1882] Fix | Delete
[1883] Fix | Delete
parts = splitDateTime(dateTimeString, timeSettings);
[1884] Fix | Delete
date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
[1885] Fix | Delete
[1886] Fix | Delete
if (parts.timeString === '') {
[1887] Fix | Delete
return {
[1888] Fix | Delete
date: date
[1889] Fix | Delete
};
[1890] Fix | Delete
}
[1891] Fix | Delete
[1892] Fix | Delete
parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
[1893] Fix | Delete
[1894] Fix | Delete
if (!parsedTime) {
[1895] Fix | Delete
throw 'Wrong time format';
[1896] Fix | Delete
}
[1897] Fix | Delete
[1898] Fix | Delete
return {
[1899] Fix | Delete
date: date,
[1900] Fix | Delete
timeObj: parsedTime
[1901] Fix | Delete
};
[1902] Fix | Delete
};
[1903] Fix | Delete
[1904] Fix | Delete
/*
[1905] Fix | Delete
* Internal function to set timezone_select to the local timezone
[1906] Fix | Delete
*/
[1907] Fix | Delete
var selectLocalTimezone = function (tp_inst, date) {
[1908] Fix | Delete
if (tp_inst && tp_inst.timezone_select) {
[1909] Fix | Delete
var now = date || new Date();
[1910] Fix | Delete
tp_inst.timezone_select.val(-now.getTimezoneOffset());
[1911] Fix | Delete
}
[1912] Fix | Delete
};
[1913] Fix | Delete
[1914] Fix | Delete
/*
[1915] Fix | Delete
* Create a Singleton Instance
[1916] Fix | Delete
*/
[1917] Fix | Delete
$.timepicker = new Timepicker();
[1918] Fix | Delete
[1919] Fix | Delete
/**
[1920] Fix | Delete
* Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
[1921] Fix | Delete
* @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
[1922] Fix | Delete
* @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
[1923] Fix | Delete
* @return {string}
[1924] Fix | Delete
*/
[1925] Fix | Delete
$.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
[1926] Fix | Delete
if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
[1927] Fix | Delete
return tzMinutes;
[1928] Fix | Delete
}
[1929] Fix | Delete
[1930] Fix | Delete
var off = tzMinutes,
[1931] Fix | Delete
minutes = off % 60,
[1932] Fix | Delete
hours = (off - minutes) / 60,
[1933] Fix | Delete
iso = iso8601 ? ':' : '',
[1934] Fix | Delete
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
[1935] Fix | Delete
[1936] Fix | Delete
if (tz === '+00:00') {
[1937] Fix | Delete
return 'Z';
[1938] Fix | Delete
}
[1939] Fix | Delete
return tz;
[1940] Fix | Delete
};
[1941] Fix | Delete
[1942] Fix | Delete
/**
[1943] Fix | Delete
* Get the number in minutes that represents a timezone string
[1944] Fix | Delete
* @param {string} tzString formatted like "+0500", "-1245", "Z"
[1945] Fix | Delete
* @return {number} the offset minutes or the original string if it doesn't match expectations
[1946] Fix | Delete
*/
[1947] Fix | Delete
$.timepicker.timezoneOffsetNumber = function (tzString) {
[1948] Fix | Delete
var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245"
[1949] Fix | Delete
[1950] Fix | Delete
if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset
[1951] Fix | Delete
return 0;
[1952] Fix | Delete
}
[1953] Fix | Delete
[1954] Fix | Delete
if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
[1955] Fix | Delete
return tzString;
[1956] Fix | Delete
}
[1957] Fix | Delete
[1958] Fix | Delete
return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
[1959] Fix | Delete
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
[1960] Fix | Delete
parseInt(normalized.substr(3, 2), 10))); // minutes
[1961] Fix | Delete
};
[1962] Fix | Delete
[1963] Fix | Delete
/**
[1964] Fix | Delete
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
[1965] Fix | Delete
* @param {Date} date
[1966] Fix | Delete
* @param {string} toTimezone formatted like "+0500", "-1245"
[1967] Fix | Delete
* @return {Date}
[1968] Fix | Delete
*/
[1969] Fix | Delete
$.timepicker.timezoneAdjust = function (date, toTimezone) {
[1970] Fix | Delete
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
[1971] Fix | Delete
if (!isNaN(toTz)) {
[1972] Fix | Delete
date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
[1973] Fix | Delete
}
[1974] Fix | Delete
return date;
[1975] Fix | Delete
};
[1976] Fix | Delete
[1977] Fix | Delete
/**
[1978] Fix | Delete
* Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
[1979] Fix | Delete
* enforce date range limits.
[1980] Fix | Delete
* n.b. The input value must be correctly formatted (reformatting is not supported)
[1981] Fix | Delete
* @param {Element} startTime
[1982] Fix | Delete
* @param {Element} endTime
[1983] Fix | Delete
* @param {Object} options Options for the timepicker() call
[1984] Fix | Delete
* @return {jQuery}
[1985] Fix | Delete
*/
[1986] Fix | Delete
$.timepicker.timeRange = function (startTime, endTime, options) {
[1987] Fix | Delete
return $.timepicker.handleRange('timepicker', startTime, endTime, options);
[1988] Fix | Delete
};
[1989] Fix | Delete
[1990] Fix | Delete
/**
[1991] Fix | Delete
* Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
[1992] Fix | Delete
* enforce date range limits.
[1993] Fix | Delete
* @param {Element} startTime
[1994] Fix | Delete
* @param {Element} endTime
[1995] Fix | Delete
* @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
[1996] Fix | Delete
* a boolean value that can be used to reformat the input values to the `dateFormat`.
[1997] Fix | Delete
* @param {string} method Can be used to specify the type of picker to be added
[1998] Fix | Delete
* @return {jQuery}
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function