Home | History | Annotate | Download | only in sunspider-1.0

Lines Matching defs:Date

14 Date.parseFunctions = {count:0};
15 Date.parseRegexes = [];
16 Date.formatFunctions = {count:0};
18 Date.prototype.dateFormat = function(format) {
19 if (Date.formatFunctions[format] == null) {
20 Date.createNewFormat(format);
22 var func = Date.formatFunctions[format];
26 Date.createNewFormat = function(format) {
27 var funcName = "format" + Date.formatFunctions.count++;
28 Date.formatFunctions[format] = funcName;
29 var code = "Date.prototype." + funcName + " = function(){return ";
42 code += Date.getFormatCode(ch);
48 Date.getFormatCode = function(character) {
53 return "Date.dayNames[this.getDay()].substring(0, 3) + ";
57 return "Date.dayNames[this.getDay()] + ";
67 return "Date.monthNames[this.getMonth()] + ";
71 return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
109 Date.parseDate = function(input, format) {
110 if (Date.parseFunctions[format] == null) {
111 Date.createParser(format);
113 var func = Date.parseFunctions[format];
114 return Date[func](input);
117 Date.createParser = function(format) {
118 var funcName = "parse" + Date.parseFunctions.count++;
119 var regexNum = Date.parseRegexes.length;
121 Date.parseFunctions[format] = funcName;
123 var code = "Date." + funcName + " = function(input){\n"
125 + "var d = new Date();\n"
129 + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
145 obj = Date.formatCodeToRegex(ch, currentGroup);
155 + "{return new Date(y, m, d, h, i, s);}\n"
157 + "{return new Date(y, m, d, h, i);}\n"
159 + "{return new Date(y, m, d, h);}\n"
161 + "{return new Date(y, m, d);}\n"
163 + "{return new Date(y, m);}\n"
165 + "{return new Date(y);}\n"
168 Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
172 Date.formatCodeToRegex = function(character, currentGroup) {
186 s:"(?:" + Date.dayNames.join("|") + ")"};
205 c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
206 s:"(" + Date.monthNames.join("|") + ")"};
209 c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
231 + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
279 Date.prototype.getTimezone = function() {
285 Date.prototype.getGMTOffset = function() {
291 Date.prototype.getDayOfYear = function() {
293 Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
295 num += Date.daysInMonth[i];
300 Date.prototype.getWeekOfYear = function() {
304 var jan1 = new Date(this.getFullYear(), 0, 1);
310 Date.prototype.isLeapYear = function() {
315 Date.prototype.getFirstDayOfMonth = function() {
320 Date.prototype.getLastDayOfMonth = function() {
321 var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
325 Date.prototype.getDaysInMonth = function() {
326 Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
327 return Date.daysInMonth[this.getMonth()];
330 Date.prototype.getSuffix = function() {
362 Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
363 Date.monthNames =
376 Date.dayNames =
384 Date.y2kYear = 50;
385 Date.monthNumbers = {
398 Date.patterns = {
411 var date = new Date("1/1/2007 1:11:11");
414 var shortFormat = date.dateFormat("Y-m-d");
415 var longFormat = date.dateFormat("l, F d, Y g:i:s A");
416 date.setTime(date.getTime() + 84266956);