Removed unused custom library.

This commit is contained in:
Alexis Lahouze 2013-02-07 15:03:43 +01:00
parent fae2ca8fd0
commit 338e24792c

View File

@ -1,69 +0,0 @@
// a global month names array
var gsMonthNames = new Array(
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
);
// a global day names array
var gsDayNames = new Array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);
// VB-like string replicator
String.prototype.times = function(n)
{
var s = '';
for (var i = 0; i < n; i++)
s += this;
return s;
}
// Zero-Padding
String.prototype.zp = function(n) { return '0'.times(n - this.length) + this; }
Number.prototype.zp = function(n) { thisStr = this.toString(); return '0'.times(n - thisStr.length) + thisStr; }
// the date format prototype
Date.prototype.format = function(f)
{
if (!this.valueOf())
return '&nbsp;';
var d = this;
return f.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,
function($1)
{
switch ($1.toLowerCase())
{
case 'yyyy': return d.getFullYear();
case 'mmmm': return gsMonthNames[d.getMonth()];
case 'mmm': return gsMonthNames[d.getMonth()].substr(0, 3);
case 'mm': return (d.getMonth() + 1).zp(2);
case 'dddd': return gsDayNames[d.getDay()];
case 'ddd': return gsDayNames[d.getDay()].substr(0, 3);
case 'dd': return d.getDate().zp(2);
case 'hh': return ((h = d.getHours() % 12) ? h : 12).zp(2);
case 'nn': return d.getMinutes().zp(2);
case 'ss': return d.getSeconds().zp(2);
case 'a/p': return d.getHours() < 12 ? 'a' : 'p';
}
}
);
}