Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\js\edeal\libraries\jquery\plugins\__jquery-dateFormat.js
(function (jQuery) { var daysInWeek = ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", 'Vendredi', "Samedi"]; var shortMonthsInYear = ["Jan", "Fev", "Mar", "Avr", "Mai", "Juin", "Jui", "Août", "Sep", "Oct", "Nov", "Dec"]; var longMonthsInYear = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]; var labelAMomentAgo = "A l\'instant"; var labelMinute = "minute"; var labelMinutes = "minutes"; var labelAgo = "Il y a"; var labelHour = "heure"; var labelHours = "heures"; var labelYesterday = "Hier"; var labelAt = "à"; var labelDay = "jour"; var labelDays = "jours"; var labelLastMonth = "Le mois dernier"; var labelLast = "dernier"; var labelMonths = "mois"; var labelYears = "années"; var labelLastYear = "L\'année dernière"; var labelOClock = "o\'clock"; var shortMonthsToNumber = []; shortMonthsToNumber["Jan"] = "01"; shortMonthsToNumber["Feb"] = "02"; shortMonthsToNumber["Mar"] = "03"; shortMonthsToNumber["Apr"] = "04"; shortMonthsToNumber["May"] = "05"; shortMonthsToNumber["Jun"] = "06"; shortMonthsToNumber["Jul"] = "07"; shortMonthsToNumber["Aug"] = "08"; shortMonthsToNumber["Sep"] = "09"; shortMonthsToNumber["Oct"] = "10"; shortMonthsToNumber["Nov"] = "11"; shortMonthsToNumber["Dec"] = "12"; var DateDiff = { inSeconds: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2-t1)/(1000)); }, inMinutes: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2-t1)/(60*1000)); }, inHours: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2-t1)/(3600*1000)); }, inDays: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2-t1)/(24*3600*1000)); }, inWeeks: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2-t1)/(24*3600*1000*7)); }, inMonths: function(d1, d2) { var d1Y = d1.getFullYear(); var d2Y = d2.getFullYear(); var d1M = d1.getMonth(); var d2M = d2.getMonth(); return (d2M+12*d2Y)-(d1M+12*d1Y); }, inYears: function(d1, d2) { return d2.getFullYear()-d1.getFullYear(); } }; jQuery.format = (function () { function strDay(value) { return daysInWeek[parseInt(value, 10)] || value; } function strMonth(value) { var monthArrayIndex = parseInt(value, 10) - 1; return shortMonthsInYear[monthArrayIndex] || value; } function strLongMonth(value) { var monthArrayIndex = parseInt(value, 10) - 1; return longMonthsInYear[monthArrayIndex] || value; } var parseMonth = function (value) { return shortMonthsToNumber[value] || value; }; var parseTime = function (value) { var retValue = value; var millis = ""; if (retValue.indexOf(".") !== -1) { var delimited = retValue.split('.'); retValue = delimited[0]; millis = delimited[1]; } var values3 = retValue.split(":"); if (values3.length === 3) { hour = values3[0]; minute = values3[1]; second = values3[2]; return { time: retValue, hour: hour, minute: minute, second: second, millis: millis }; } else { return { time: "", hour: "", minute: "", second: "", millis: "" }; } }; return { date: function (value, format, locale) { if ($.datepicker.regional[locale]) { daysInWeek = $.datepicker.regional[locale].dayNames; shortMonthsInYear = $.datepicker.regional[locale].monthNamesShort; longMonthsInYear = $.datepicker.regional[locale].monthNames; labelAMomentAgo = $.datepicker.regional[locale].labelAMomentAgo; labelMinute = $.datepicker.regional[locale].labelMinute; labelMinutes = $.datepicker.regional[locale].labelMinutes; labelAgo = $.datepicker.regional[locale].labelAgo; labelHour = $.datepicker.regional[locale].labelHour; labelHours = $.datepicker.regional[locale].labelHours; labelYesterday = $.datepicker.regional[locale].labelYesterday; labelAt = $.datepicker.regional[locale].labelAt; labelDay = $.datepicker.regional[locale].labelDay; labelDays = $.datepicker.regional[locale].labelDays; labelLastMonth = $.datepicker.regional[locale].labelLastMonth; labelLast = $.datepicker.regional[locale].labelLast; labelMonths = $.datepicker.regional[locale].labelMonths; labelYears = $.datepicker.regional[locale].labelYears; labelLastYear = $.datepicker.regional[locale].labelLastYear; labelOClock = $.datepicker.regional[locale].labelOClock; } /* * value always in that format : dd/MM/yyyy HH:mm:ss */ try { var date = null; var year = null; var month = null; var dayOfMonth = null; var dayOfWeek = null; var time = null; if (typeof value == "number"){ return this.date(new Date(value), format); } else if (typeof value.getFullYear == "function") { year = value.getFullYear(); month = value.getMonth() + 1; dayOfMonth = value.getDate(); dayOfWeek = value.getDay(); time = parseTime(value.toTimeString()); } else if (value.search(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d{0,3}[-+]?\d{2}:?\d{2}/) != -1) { /* 2009-04-19T16:11:05+02:00 */ var values = value.split(/[T\+-]/); year = values[0]; month = values[1]; dayOfMonth = values[2]; time = parseTime(values[3].split(".")[0]); date = new Date(year, month - 1, dayOfMonth); dayOfWeek = date.getDay(); } else { var values = value.split(" "); switch (values.length) { case 6: /* Wed Jan 13 10:43:41 CET 2010 */ year = values[5]; month = parseMonth(values[1]); dayOfMonth = values[2]; time = parseTime(values[3]); date = new Date(year, month - 1, dayOfMonth); dayOfWeek = date.getDay(); break; case 2: /* 18/12/2012 10:54:50.546 */ var values2 = values[0].split("/"); year = values2[2]; month = values2[1]; dayOfMonth = values2[0]; time = parseTime(values[1]); date = new Date(year, month - 1, dayOfMonth); dayOfWeek = date.getDay(); break; case 7: /* Tue Mar 01 2011 12:01:42 GMT-0800 (PST) */ case 9: /*added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0800 (China Standard Time) */ case 10: /* added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0200 (W. Europe Daylight Time) */ year = values[3]; month = parseMonth(values[1]); dayOfMonth = values[2]; time = parseTime(values[4]); date = new Date(year, month - 1, dayOfMonth); dayOfWeek = date.getDay(); break; case 1: /* added by Jonny, for 2012-02-07CET00:00:00 (Doctrine Entity -> Json Serializer) */ var values2 = values[0].split(""); year=values2[0]+values2[1]+values2[2]+values2[3]; month= values2[5]+values2[6]; dayOfMonth = values2[8]+values2[9]; time = parseTime(values2[13]+values2[14]+values2[15]+values2[16]+values2[17]+values2[18]+values2[19]+values2[20]) date = new Date(year, month - 1, dayOfMonth); dayOfWeek = date.getDay(); break; default: return value; } } var pattern = ""; var retValue = ""; var unparsedRest = ""; /* Issue 1 - variable scope issue in format.date Thanks jakemonO */ var currentDate = new Date(year, month - 1, dayOfMonth, time.hour, time.minute, time.second); //var currentTime = time; if (format == "SMART_FORMAT") { var nowDate = new Date(); var diffInSeconds = DateDiff.inSeconds(currentDate, nowDate); if (diffInSeconds < 60) { return labelAMomentAgo; } else { var diffInMinutes = DateDiff.inMinutes(currentDate, nowDate); if (diffInMinutes < 60) { if (diffInMinutes == 1) { if (locale == "en") { return diffInMinutes + " " + labelMinute + " " + labelAgo; } else { return labelAgo + " " + diffInMinutes + " " + labelMinute; } } else { if (locale == "en") { return diffInMinutes + " " + labelMinutes + " " + labelAgo; } else { return labelAgo + " " + diffInMinutes + " " + labelMinutes; } } } else { var diffInDays = DateDiff.inDays(currentDate, nowDate); var diffInHours = DateDiff.inHours(currentDate, nowDate); if (diffInHours < 24) { if (diffInDays == 0) { if (diffInHours == 1) { if (locale == "en") { return diffInHours + " " + labelHour + " " + labelAgo; } else { return labelAgo + " " + diffInHours + " " + labelHours; } } else { var midnightDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()); var diffSinceMidnight = DateDiff.inHours(midnightDate, nowDate); if (diffInHours > diffSinceMidnight) { return labelYesterday + " " + labelAt + " " + time.hour + " " + labelOClock; } else { if (locale == "en") { return diffInHours + " " + labelHour + " " + labelAgo; } else { return labelAgo + " " + diffInHours + " " + labelHours; } } } } else { return labelYesterday + " " + labelAt + " " + time.hour + " " + labelOClock; } } else { var diffInMonth = DateDiff.inMonths(currentDate, nowDate); if (diffInDays == 1) { return labelYesterday + " " + labelAt + " " + time.hour + " " + labelOClock; } else { if (diffInMonth == 0) { if (diffInDays < 7) { return daysInWeek[currentDate.getDay()] + " " + labelAt + " " + time.hour + " " + labelOClock; } else { if (locale == "en") { return diffInDays + " " + labelDay + " " + labelAgo; } else { return labelAgo + " " + diffInDays + " " + labelDays; } } } else { if (diffInMonth == 1) { return labelLastMonth; } else { var diffInYears = DateDiff.inYears(currentDate, nowDate); if (diffInYears == 0) { if (diffInMonth < 12) { return longMonthsInYear[currentDate.getMonth()] + " " + labelLast; } else { if (locale == "en") { return diffInMonth + " " + labelMonths + " " + labelAgo; } else { return labelAgo + " " + diffInMonth + " " + labelMonths; } } } else { if (diffInYears == 1) { return labelLastYear; } else { if (locale == "en") { return diffInYears + " " + labelYears + " " + labelAgo; } else { return labelAgo + " " + diffInYears + " " + labelYears; } } } } } } } } } } else { for (var i = 0; i < format.length; i++) { var currentPattern = format.charAt(i); pattern += currentPattern; unparsedRest = ""; switch (pattern) { case "ddd": retValue += strDay(dayOfWeek); pattern = ""; break; case "dd": if (format.charAt(i + 1) == "d") { break; } if (String(dayOfMonth).length === 1) { dayOfMonth = '0' + dayOfMonth; } retValue += dayOfMonth; pattern = ""; break; case "d": if (format.charAt(i + 1) == "d") { break; } retValue += parseInt(dayOfMonth, 10); pattern = ""; break; case "MMMM": retValue += strLongMonth(month); pattern = ""; break; case "MMM": if (format.charAt(i + 1) === "M") { break; } retValue += strMonth(month); pattern = ""; break; case "MM": if (format.charAt(i + 1) == "M") { break; } if (String(month).length === 1) { month = '0' + month; } retValue += month; pattern = ""; break; case "M": if (format.charAt(i + 1) == "M") { break; } retValue += parseInt(month, 10); pattern = ""; break; case "yyyy": retValue += year; pattern = ""; break; case "yy": if (format.charAt(i + 1) == "y" && format.charAt(i + 2) == "y") { break; } retValue += String(year).slice(-2); pattern = ""; break; case "HH": retValue += time.hour; pattern = ""; break; case "hh": /* time.hour is "00" as string == is used instead of === */ var hour = (time.hour == 0 ? 12 : time.hour < 13 ? time.hour : time.hour - 12); hour = String(hour).length == 1 ? '0' + hour : hour; retValue += hour; pattern = ""; break; case "h": if (format.charAt(i + 1) == "h") { break; } var hour = (time.hour == 0 ? 12 : time.hour < 13 ? time.hour : time.hour - 12); retValue += parseInt(hour, 10); // Fixing issue https://github.com/phstc/jquery-dateFormat/issues/21 // retValue = parseInt(retValue, 10); pattern = ""; break; case "mm": retValue += time.minute; pattern = ""; break; case "ss": /* ensure only seconds are added to the return string */ retValue += time.second.substring(0, 2); pattern = ""; break; case "SSS": retValue += time.millis.substring(0, 3); pattern = ""; break; case "a": retValue += time.hour >= 12 ? "PM" : "AM"; pattern = ""; break; case " ": retValue += currentPattern; pattern = ""; break; case "/": retValue += currentPattern; pattern = ""; break; case ":": retValue += currentPattern; pattern = ""; break; default: if (pattern.length === 2 && pattern.indexOf("y") !== 0 && pattern != "SS") { retValue += pattern.substring(0, 1); pattern = pattern.substring(1, 2); } else if ((pattern.length === 3 && pattern.indexOf("yyy") === -1)) { pattern = ""; } else { unparsedRest = pattern; } } } retValue += unparsedRest; return retValue; } } catch (e) { console.log(e); return value; } } }; }()); }(jQuery)); jQuery.format.date.defaultShortDateFormat = "dd/MM/yyyy"; jQuery.format.date.defaultLongDateFormat = "dd/MM/yyyy hh:mm:ss"; jQuery(document).ready(function () { jQuery(".shortDateFormat").each(function (idx, elem) { if (jQuery(elem).is(":input")) { jQuery(elem).val(jQuery.format.date(jQuery(elem).val(), jQuery.format.date.defaultShortDateFormat)); } else { jQuery(elem).text(jQuery.format.date(jQuery(elem).text(), jQuery.format.date.defaultShortDateFormat)); } }); jQuery(".longDateFormat").each(function (idx, elem) { if (jQuery(elem).is(":input")) { jQuery(elem).val(jQuery.format.date(jQuery(elem).val(), jQuery.format.date.defaultLongDateFormat)); } else { jQuery(elem).text(jQuery.format.date(jQuery(elem).text(), jQuery.format.date.defaultLongDateFormat)); } }); });
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de