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-inclu.../js/jquery/ui
File: datepicker.js
}
[1000] Fix | Delete
},
[1001] Fix | Delete
[1002] Fix | Delete
/* Tidy up after a dialog display. */
[1003] Fix | Delete
_tidyDialog: function( inst ) {
[1004] Fix | Delete
inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
[1005] Fix | Delete
},
[1006] Fix | Delete
[1007] Fix | Delete
/* Close date picker if clicked elsewhere. */
[1008] Fix | Delete
_checkExternalClick: function( event ) {
[1009] Fix | Delete
if ( !$.datepicker._curInst ) {
[1010] Fix | Delete
return;
[1011] Fix | Delete
}
[1012] Fix | Delete
[1013] Fix | Delete
var $target = $( event.target ),
[1014] Fix | Delete
inst = $.datepicker._getInst( $target[ 0 ] );
[1015] Fix | Delete
[1016] Fix | Delete
if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
[1017] Fix | Delete
$target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
[1018] Fix | Delete
!$target.hasClass( $.datepicker.markerClassName ) &&
[1019] Fix | Delete
!$target.closest( "." + $.datepicker._triggerClass ).length &&
[1020] Fix | Delete
$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
[1021] Fix | Delete
( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
[1022] Fix | Delete
$.datepicker._hideDatepicker();
[1023] Fix | Delete
}
[1024] Fix | Delete
},
[1025] Fix | Delete
[1026] Fix | Delete
/* Adjust one of the date sub-fields. */
[1027] Fix | Delete
_adjustDate: function( id, offset, period ) {
[1028] Fix | Delete
var target = $( id ),
[1029] Fix | Delete
inst = this._getInst( target[ 0 ] );
[1030] Fix | Delete
[1031] Fix | Delete
if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
[1032] Fix | Delete
return;
[1033] Fix | Delete
}
[1034] Fix | Delete
this._adjustInstDate( inst, offset, period );
[1035] Fix | Delete
this._updateDatepicker( inst );
[1036] Fix | Delete
},
[1037] Fix | Delete
[1038] Fix | Delete
/* Action for current link. */
[1039] Fix | Delete
_gotoToday: function( id ) {
[1040] Fix | Delete
var date,
[1041] Fix | Delete
target = $( id ),
[1042] Fix | Delete
inst = this._getInst( target[ 0 ] );
[1043] Fix | Delete
[1044] Fix | Delete
if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
[1045] Fix | Delete
inst.selectedDay = inst.currentDay;
[1046] Fix | Delete
inst.drawMonth = inst.selectedMonth = inst.currentMonth;
[1047] Fix | Delete
inst.drawYear = inst.selectedYear = inst.currentYear;
[1048] Fix | Delete
} else {
[1049] Fix | Delete
date = new Date();
[1050] Fix | Delete
inst.selectedDay = date.getDate();
[1051] Fix | Delete
inst.drawMonth = inst.selectedMonth = date.getMonth();
[1052] Fix | Delete
inst.drawYear = inst.selectedYear = date.getFullYear();
[1053] Fix | Delete
}
[1054] Fix | Delete
this._notifyChange( inst );
[1055] Fix | Delete
this._adjustDate( target );
[1056] Fix | Delete
},
[1057] Fix | Delete
[1058] Fix | Delete
/* Action for selecting a new month/year. */
[1059] Fix | Delete
_selectMonthYear: function( id, select, period ) {
[1060] Fix | Delete
var target = $( id ),
[1061] Fix | Delete
inst = this._getInst( target[ 0 ] );
[1062] Fix | Delete
[1063] Fix | Delete
inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
[1064] Fix | Delete
inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
[1065] Fix | Delete
parseInt( select.options[ select.selectedIndex ].value, 10 );
[1066] Fix | Delete
[1067] Fix | Delete
this._notifyChange( inst );
[1068] Fix | Delete
this._adjustDate( target );
[1069] Fix | Delete
},
[1070] Fix | Delete
[1071] Fix | Delete
/* Action for selecting a day. */
[1072] Fix | Delete
_selectDay: function( id, month, year, td ) {
[1073] Fix | Delete
var inst,
[1074] Fix | Delete
target = $( id );
[1075] Fix | Delete
[1076] Fix | Delete
if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
[1077] Fix | Delete
return;
[1078] Fix | Delete
}
[1079] Fix | Delete
[1080] Fix | Delete
inst = this._getInst( target[ 0 ] );
[1081] Fix | Delete
inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) );
[1082] Fix | Delete
inst.selectedMonth = inst.currentMonth = month;
[1083] Fix | Delete
inst.selectedYear = inst.currentYear = year;
[1084] Fix | Delete
this._selectDate( id, this._formatDate( inst,
[1085] Fix | Delete
inst.currentDay, inst.currentMonth, inst.currentYear ) );
[1086] Fix | Delete
},
[1087] Fix | Delete
[1088] Fix | Delete
/* Erase the input field and hide the date picker. */
[1089] Fix | Delete
_clearDate: function( id ) {
[1090] Fix | Delete
var target = $( id );
[1091] Fix | Delete
this._selectDate( target, "" );
[1092] Fix | Delete
},
[1093] Fix | Delete
[1094] Fix | Delete
/* Update the input field with the selected date. */
[1095] Fix | Delete
_selectDate: function( id, dateStr ) {
[1096] Fix | Delete
var onSelect,
[1097] Fix | Delete
target = $( id ),
[1098] Fix | Delete
inst = this._getInst( target[ 0 ] );
[1099] Fix | Delete
[1100] Fix | Delete
dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
[1101] Fix | Delete
if ( inst.input ) {
[1102] Fix | Delete
inst.input.val( dateStr );
[1103] Fix | Delete
}
[1104] Fix | Delete
this._updateAlternate( inst );
[1105] Fix | Delete
[1106] Fix | Delete
onSelect = this._get( inst, "onSelect" );
[1107] Fix | Delete
if ( onSelect ) {
[1108] Fix | Delete
onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback
[1109] Fix | Delete
} else if ( inst.input ) {
[1110] Fix | Delete
inst.input.trigger( "change" ); // fire the change event
[1111] Fix | Delete
}
[1112] Fix | Delete
[1113] Fix | Delete
if ( inst.inline ) {
[1114] Fix | Delete
this._updateDatepicker( inst );
[1115] Fix | Delete
} else {
[1116] Fix | Delete
this._hideDatepicker();
[1117] Fix | Delete
this._lastInput = inst.input[ 0 ];
[1118] Fix | Delete
if ( typeof( inst.input[ 0 ] ) !== "object" ) {
[1119] Fix | Delete
inst.input.trigger( "focus" ); // restore focus
[1120] Fix | Delete
}
[1121] Fix | Delete
this._lastInput = null;
[1122] Fix | Delete
}
[1123] Fix | Delete
},
[1124] Fix | Delete
[1125] Fix | Delete
/* Update any alternate field to synchronise with the main field. */
[1126] Fix | Delete
_updateAlternate: function( inst ) {
[1127] Fix | Delete
var altFormat, date, dateStr,
[1128] Fix | Delete
altField = this._get( inst, "altField" );
[1129] Fix | Delete
[1130] Fix | Delete
if ( altField ) { // update alternate field too
[1131] Fix | Delete
altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
[1132] Fix | Delete
date = this._getDate( inst );
[1133] Fix | Delete
dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
[1134] Fix | Delete
$( document ).find( altField ).val( dateStr );
[1135] Fix | Delete
}
[1136] Fix | Delete
},
[1137] Fix | Delete
[1138] Fix | Delete
/* Set as beforeShowDay function to prevent selection of weekends.
[1139] Fix | Delete
* @param date Date - the date to customise
[1140] Fix | Delete
* @return [boolean, string] - is this date selectable?, what is its CSS class?
[1141] Fix | Delete
*/
[1142] Fix | Delete
noWeekends: function( date ) {
[1143] Fix | Delete
var day = date.getDay();
[1144] Fix | Delete
return [ ( day > 0 && day < 6 ), "" ];
[1145] Fix | Delete
},
[1146] Fix | Delete
[1147] Fix | Delete
/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
[1148] Fix | Delete
* @param date Date - the date to get the week for
[1149] Fix | Delete
* @return number - the number of the week within the year that contains this date
[1150] Fix | Delete
*/
[1151] Fix | Delete
iso8601Week: function( date ) {
[1152] Fix | Delete
var time,
[1153] Fix | Delete
checkDate = new Date( date.getTime() );
[1154] Fix | Delete
[1155] Fix | Delete
// Find Thursday of this week starting on Monday
[1156] Fix | Delete
checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
[1157] Fix | Delete
[1158] Fix | Delete
time = checkDate.getTime();
[1159] Fix | Delete
checkDate.setMonth( 0 ); // Compare with Jan 1
[1160] Fix | Delete
checkDate.setDate( 1 );
[1161] Fix | Delete
return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
[1162] Fix | Delete
},
[1163] Fix | Delete
[1164] Fix | Delete
/* Parse a string value into a date object.
[1165] Fix | Delete
* See formatDate below for the possible formats.
[1166] Fix | Delete
*
[1167] Fix | Delete
* @param format string - the expected format of the date
[1168] Fix | Delete
* @param value string - the date in the above format
[1169] Fix | Delete
* @param settings Object - attributes include:
[1170] Fix | Delete
* shortYearCutoff number - the cutoff year for determining the century (optional)
[1171] Fix | Delete
* dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
[1172] Fix | Delete
* dayNames string[7] - names of the days from Sunday (optional)
[1173] Fix | Delete
* monthNamesShort string[12] - abbreviated names of the months (optional)
[1174] Fix | Delete
* monthNames string[12] - names of the months (optional)
[1175] Fix | Delete
* @return Date - the extracted date value or null if value is blank
[1176] Fix | Delete
*/
[1177] Fix | Delete
parseDate: function( format, value, settings ) {
[1178] Fix | Delete
if ( format == null || value == null ) {
[1179] Fix | Delete
throw "Invalid arguments";
[1180] Fix | Delete
}
[1181] Fix | Delete
[1182] Fix | Delete
value = ( typeof value === "object" ? value.toString() : value + "" );
[1183] Fix | Delete
if ( value === "" ) {
[1184] Fix | Delete
return null;
[1185] Fix | Delete
}
[1186] Fix | Delete
[1187] Fix | Delete
var iFormat, dim, extra,
[1188] Fix | Delete
iValue = 0,
[1189] Fix | Delete
shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
[1190] Fix | Delete
shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
[1191] Fix | Delete
new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
[1192] Fix | Delete
dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
[1193] Fix | Delete
dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
[1194] Fix | Delete
monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
[1195] Fix | Delete
monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
[1196] Fix | Delete
year = -1,
[1197] Fix | Delete
month = -1,
[1198] Fix | Delete
day = -1,
[1199] Fix | Delete
doy = -1,
[1200] Fix | Delete
literal = false,
[1201] Fix | Delete
date,
[1202] Fix | Delete
[1203] Fix | Delete
// Check whether a format character is doubled
[1204] Fix | Delete
lookAhead = function( match ) {
[1205] Fix | Delete
var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
[1206] Fix | Delete
if ( matches ) {
[1207] Fix | Delete
iFormat++;
[1208] Fix | Delete
}
[1209] Fix | Delete
return matches;
[1210] Fix | Delete
},
[1211] Fix | Delete
[1212] Fix | Delete
// Extract a number from the string value
[1213] Fix | Delete
getNumber = function( match ) {
[1214] Fix | Delete
var isDoubled = lookAhead( match ),
[1215] Fix | Delete
size = ( match === "@" ? 14 : ( match === "!" ? 20 :
[1216] Fix | Delete
( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
[1217] Fix | Delete
minSize = ( match === "y" ? size : 1 ),
[1218] Fix | Delete
digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
[1219] Fix | Delete
num = value.substring( iValue ).match( digits );
[1220] Fix | Delete
if ( !num ) {
[1221] Fix | Delete
throw "Missing number at position " + iValue;
[1222] Fix | Delete
}
[1223] Fix | Delete
iValue += num[ 0 ].length;
[1224] Fix | Delete
return parseInt( num[ 0 ], 10 );
[1225] Fix | Delete
},
[1226] Fix | Delete
[1227] Fix | Delete
// Extract a name from the string value and convert to an index
[1228] Fix | Delete
getName = function( match, shortNames, longNames ) {
[1229] Fix | Delete
var index = -1,
[1230] Fix | Delete
names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
[1231] Fix | Delete
return [ [ k, v ] ];
[1232] Fix | Delete
} ).sort( function( a, b ) {
[1233] Fix | Delete
return -( a[ 1 ].length - b[ 1 ].length );
[1234] Fix | Delete
} );
[1235] Fix | Delete
[1236] Fix | Delete
$.each( names, function( i, pair ) {
[1237] Fix | Delete
var name = pair[ 1 ];
[1238] Fix | Delete
if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
[1239] Fix | Delete
index = pair[ 0 ];
[1240] Fix | Delete
iValue += name.length;
[1241] Fix | Delete
return false;
[1242] Fix | Delete
}
[1243] Fix | Delete
} );
[1244] Fix | Delete
if ( index !== -1 ) {
[1245] Fix | Delete
return index + 1;
[1246] Fix | Delete
} else {
[1247] Fix | Delete
throw "Unknown name at position " + iValue;
[1248] Fix | Delete
}
[1249] Fix | Delete
},
[1250] Fix | Delete
[1251] Fix | Delete
// Confirm that a literal character matches the string value
[1252] Fix | Delete
checkLiteral = function() {
[1253] Fix | Delete
if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
[1254] Fix | Delete
throw "Unexpected literal at position " + iValue;
[1255] Fix | Delete
}
[1256] Fix | Delete
iValue++;
[1257] Fix | Delete
};
[1258] Fix | Delete
[1259] Fix | Delete
for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
[1260] Fix | Delete
if ( literal ) {
[1261] Fix | Delete
if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
[1262] Fix | Delete
literal = false;
[1263] Fix | Delete
} else {
[1264] Fix | Delete
checkLiteral();
[1265] Fix | Delete
}
[1266] Fix | Delete
} else {
[1267] Fix | Delete
switch ( format.charAt( iFormat ) ) {
[1268] Fix | Delete
case "d":
[1269] Fix | Delete
day = getNumber( "d" );
[1270] Fix | Delete
break;
[1271] Fix | Delete
case "D":
[1272] Fix | Delete
getName( "D", dayNamesShort, dayNames );
[1273] Fix | Delete
break;
[1274] Fix | Delete
case "o":
[1275] Fix | Delete
doy = getNumber( "o" );
[1276] Fix | Delete
break;
[1277] Fix | Delete
case "m":
[1278] Fix | Delete
month = getNumber( "m" );
[1279] Fix | Delete
break;
[1280] Fix | Delete
case "M":
[1281] Fix | Delete
month = getName( "M", monthNamesShort, monthNames );
[1282] Fix | Delete
break;
[1283] Fix | Delete
case "y":
[1284] Fix | Delete
year = getNumber( "y" );
[1285] Fix | Delete
break;
[1286] Fix | Delete
case "@":
[1287] Fix | Delete
date = new Date( getNumber( "@" ) );
[1288] Fix | Delete
year = date.getFullYear();
[1289] Fix | Delete
month = date.getMonth() + 1;
[1290] Fix | Delete
day = date.getDate();
[1291] Fix | Delete
break;
[1292] Fix | Delete
case "!":
[1293] Fix | Delete
date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
[1294] Fix | Delete
year = date.getFullYear();
[1295] Fix | Delete
month = date.getMonth() + 1;
[1296] Fix | Delete
day = date.getDate();
[1297] Fix | Delete
break;
[1298] Fix | Delete
case "'":
[1299] Fix | Delete
if ( lookAhead( "'" ) ) {
[1300] Fix | Delete
checkLiteral();
[1301] Fix | Delete
} else {
[1302] Fix | Delete
literal = true;
[1303] Fix | Delete
}
[1304] Fix | Delete
break;
[1305] Fix | Delete
default:
[1306] Fix | Delete
checkLiteral();
[1307] Fix | Delete
}
[1308] Fix | Delete
}
[1309] Fix | Delete
}
[1310] Fix | Delete
[1311] Fix | Delete
if ( iValue < value.length ) {
[1312] Fix | Delete
extra = value.substr( iValue );
[1313] Fix | Delete
if ( !/^\s+/.test( extra ) ) {
[1314] Fix | Delete
throw "Extra/unparsed characters found in date: " + extra;
[1315] Fix | Delete
}
[1316] Fix | Delete
}
[1317] Fix | Delete
[1318] Fix | Delete
if ( year === -1 ) {
[1319] Fix | Delete
year = new Date().getFullYear();
[1320] Fix | Delete
} else if ( year < 100 ) {
[1321] Fix | Delete
year += new Date().getFullYear() - new Date().getFullYear() % 100 +
[1322] Fix | Delete
( year <= shortYearCutoff ? 0 : -100 );
[1323] Fix | Delete
}
[1324] Fix | Delete
[1325] Fix | Delete
if ( doy > -1 ) {
[1326] Fix | Delete
month = 1;
[1327] Fix | Delete
day = doy;
[1328] Fix | Delete
do {
[1329] Fix | Delete
dim = this._getDaysInMonth( year, month - 1 );
[1330] Fix | Delete
if ( day <= dim ) {
[1331] Fix | Delete
break;
[1332] Fix | Delete
}
[1333] Fix | Delete
month++;
[1334] Fix | Delete
day -= dim;
[1335] Fix | Delete
} while ( true );
[1336] Fix | Delete
}
[1337] Fix | Delete
[1338] Fix | Delete
date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
[1339] Fix | Delete
if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
[1340] Fix | Delete
throw "Invalid date"; // E.g. 31/02/00
[1341] Fix | Delete
}
[1342] Fix | Delete
return date;
[1343] Fix | Delete
},
[1344] Fix | Delete
[1345] Fix | Delete
/* Standard date formats. */
[1346] Fix | Delete
ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
[1347] Fix | Delete
COOKIE: "D, dd M yy",
[1348] Fix | Delete
ISO_8601: "yy-mm-dd",
[1349] Fix | Delete
RFC_822: "D, d M y",
[1350] Fix | Delete
RFC_850: "DD, dd-M-y",
[1351] Fix | Delete
RFC_1036: "D, d M y",
[1352] Fix | Delete
RFC_1123: "D, d M yy",
[1353] Fix | Delete
RFC_2822: "D, d M yy",
[1354] Fix | Delete
RSS: "D, d M y", // RFC 822
[1355] Fix | Delete
TICKS: "!",
[1356] Fix | Delete
TIMESTAMP: "@",
[1357] Fix | Delete
W3C: "yy-mm-dd", // ISO 8601
[1358] Fix | Delete
[1359] Fix | Delete
_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
[1360] Fix | Delete
Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
[1361] Fix | Delete
[1362] Fix | Delete
/* Format a date object into a string value.
[1363] Fix | Delete
* The format can be combinations of the following:
[1364] Fix | Delete
* d - day of month (no leading zero)
[1365] Fix | Delete
* dd - day of month (two digit)
[1366] Fix | Delete
* o - day of year (no leading zeros)
[1367] Fix | Delete
* oo - day of year (three digit)
[1368] Fix | Delete
* D - day name short
[1369] Fix | Delete
* DD - day name long
[1370] Fix | Delete
* m - month of year (no leading zero)
[1371] Fix | Delete
* mm - month of year (two digit)
[1372] Fix | Delete
* M - month name short
[1373] Fix | Delete
* MM - month name long
[1374] Fix | Delete
* y - year (two digit)
[1375] Fix | Delete
* yy - year (four digit)
[1376] Fix | Delete
* @ - Unix timestamp (ms since 01/01/1970)
[1377] Fix | Delete
* ! - Windows ticks (100ns since 01/01/0001)
[1378] Fix | Delete
* "..." - literal text
[1379] Fix | Delete
* '' - single quote
[1380] Fix | Delete
*
[1381] Fix | Delete
* @param format string - the desired format of the date
[1382] Fix | Delete
* @param date Date - the date value to format
[1383] Fix | Delete
* @param settings Object - attributes include:
[1384] Fix | Delete
* dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
[1385] Fix | Delete
* dayNames string[7] - names of the days from Sunday (optional)
[1386] Fix | Delete
* monthNamesShort string[12] - abbreviated names of the months (optional)
[1387] Fix | Delete
* monthNames string[12] - names of the months (optional)
[1388] Fix | Delete
* @return string - the date in the above format
[1389] Fix | Delete
*/
[1390] Fix | Delete
formatDate: function( format, date, settings ) {
[1391] Fix | Delete
if ( !date ) {
[1392] Fix | Delete
return "";
[1393] Fix | Delete
}
[1394] Fix | Delete
[1395] Fix | Delete
var iFormat,
[1396] Fix | Delete
dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
[1397] Fix | Delete
dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
[1398] Fix | Delete
monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
[1399] Fix | Delete
monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
[1400] Fix | Delete
[1401] Fix | Delete
// Check whether a format character is doubled
[1402] Fix | Delete
lookAhead = function( match ) {
[1403] Fix | Delete
var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
[1404] Fix | Delete
if ( matches ) {
[1405] Fix | Delete
iFormat++;
[1406] Fix | Delete
}
[1407] Fix | Delete
return matches;
[1408] Fix | Delete
},
[1409] Fix | Delete
[1410] Fix | Delete
// Format a number, with leading zero if necessary
[1411] Fix | Delete
formatNumber = function( match, value, len ) {
[1412] Fix | Delete
var num = "" + value;
[1413] Fix | Delete
if ( lookAhead( match ) ) {
[1414] Fix | Delete
while ( num.length < len ) {
[1415] Fix | Delete
num = "0" + num;
[1416] Fix | Delete
}
[1417] Fix | Delete
}
[1418] Fix | Delete
return num;
[1419] Fix | Delete
},
[1420] Fix | Delete
[1421] Fix | Delete
// Format a name, short or long as requested
[1422] Fix | Delete
formatName = function( match, value, shortNames, longNames ) {
[1423] Fix | Delete
return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
[1424] Fix | Delete
},
[1425] Fix | Delete
output = "",
[1426] Fix | Delete
literal = false;
[1427] Fix | Delete
[1428] Fix | Delete
if ( date ) {
[1429] Fix | Delete
for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
[1430] Fix | Delete
if ( literal ) {
[1431] Fix | Delete
if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
[1432] Fix | Delete
literal = false;
[1433] Fix | Delete
} else {
[1434] Fix | Delete
output += format.charAt( iFormat );
[1435] Fix | Delete
}
[1436] Fix | Delete
} else {
[1437] Fix | Delete
switch ( format.charAt( iFormat ) ) {
[1438] Fix | Delete
case "d":
[1439] Fix | Delete
output += formatNumber( "d", date.getDate(), 2 );
[1440] Fix | Delete
break;
[1441] Fix | Delete
case "D":
[1442] Fix | Delete
output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
[1443] Fix | Delete
break;
[1444] Fix | Delete
case "o":
[1445] Fix | Delete
output += formatNumber( "o",
[1446] Fix | Delete
Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
[1447] Fix | Delete
break;
[1448] Fix | Delete
case "m":
[1449] Fix | Delete
output += formatNumber( "m", date.getMonth() + 1, 2 );
[1450] Fix | Delete
break;
[1451] Fix | Delete
case "M":
[1452] Fix | Delete
output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
[1453] Fix | Delete
break;
[1454] Fix | Delete
case "y":
[1455] Fix | Delete
output += ( lookAhead( "y" ) ? date.getFullYear() :
[1456] Fix | Delete
( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
[1457] Fix | Delete
break;
[1458] Fix | Delete
case "@":
[1459] Fix | Delete
output += date.getTime();
[1460] Fix | Delete
break;
[1461] Fix | Delete
case "!":
[1462] Fix | Delete
output += date.getTime() * 10000 + this._ticksTo1970;
[1463] Fix | Delete
break;
[1464] Fix | Delete
case "'":
[1465] Fix | Delete
if ( lookAhead( "'" ) ) {
[1466] Fix | Delete
output += "'";
[1467] Fix | Delete
} else {
[1468] Fix | Delete
literal = true;
[1469] Fix | Delete
}
[1470] Fix | Delete
break;
[1471] Fix | Delete
default:
[1472] Fix | Delete
output += format.charAt( iFormat );
[1473] Fix | Delete
}
[1474] Fix | Delete
}
[1475] Fix | Delete
}
[1476] Fix | Delete
}
[1477] Fix | Delete
return output;
[1478] Fix | Delete
},
[1479] Fix | Delete
[1480] Fix | Delete
/* Extract all possible characters from the date format. */
[1481] Fix | Delete
_possibleChars: function( format ) {
[1482] Fix | Delete
var iFormat,
[1483] Fix | Delete
chars = "",
[1484] Fix | Delete
literal = false,
[1485] Fix | Delete
[1486] Fix | Delete
// Check whether a format character is doubled
[1487] Fix | Delete
lookAhead = function( match ) {
[1488] Fix | Delete
var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
[1489] Fix | Delete
if ( matches ) {
[1490] Fix | Delete
iFormat++;
[1491] Fix | Delete
}
[1492] Fix | Delete
return matches;
[1493] Fix | Delete
};
[1494] Fix | Delete
[1495] Fix | Delete
for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
[1496] Fix | Delete
if ( literal ) {
[1497] Fix | Delete
if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
[1498] Fix | Delete
literal = false;
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function