Commit 678ff275 authored by Nick Schonning's avatar Nick Schonning

Enforce indenting with JSHint

- Doesn't differentiate between tabs and spaces
- Switch/Case indenting may seem odd to some
parent d76e1cb2
...@@ -19,5 +19,6 @@ ...@@ -19,5 +19,6 @@
}, },
"browser": true, "browser": true,
"jquery": true "jquery": true,
"indent": 4
} }
...@@ -69,25 +69,56 @@ API.txt for details. ...@@ -69,25 +69,56 @@ API.txt for details.
if (escape) { if (escape) {
switch (c) { switch (c) {
case "a": c = "" + dayNames[d.getDay()]; break; case "a":
case "b": c = "" + monthNames[d.getMonth()]; break; c = "" + dayNames[d.getDay()];
case "d": c = leftPad(d.getDate()); break; break;
case "e": c = leftPad(d.getDate(), " "); break; case "b":
c = "" + monthNames[d.getMonth()];
break;
case "d":
c = leftPad(d.getDate());
break;
case "e":
c = leftPad(d.getDate(), " ");
break;
case "h": // For back-compat with 0.7; remove in 1.0 case "h": // For back-compat with 0.7; remove in 1.0
case "H": c = leftPad(hours); break; case "H":
case "I": c = leftPad(hours12); break; c = leftPad(hours);
case "l": c = leftPad(hours12, " "); break; break;
case "m": c = leftPad(d.getMonth() + 1); break; case "I":
case "M": c = leftPad(d.getMinutes()); break; c = leftPad(hours12);
break;
case "l":
c = leftPad(hours12, " ");
break;
case "m":
c = leftPad(d.getMonth() + 1);
break;
case "M":
c = leftPad(d.getMinutes());
break;
// quarters not in Open Group's strftime specification // quarters not in Open Group's strftime specification
case "q": case "q":
c = "" + (Math.floor(d.getMonth() / 3) + 1); break; c = "" + (Math.floor(d.getMonth() / 3) + 1);
case "S": c = leftPad(d.getSeconds()); break; break;
case "y": c = leftPad(d.getFullYear() % 100); break; case "S":
case "Y": c = "" + d.getFullYear(); break; c = leftPad(d.getSeconds());
case "p": c = (isAM) ? ("" + "am") : ("" + "pm"); break; break;
case "P": c = (isAM) ? ("" + "AM") : ("" + "PM"); break; case "y":
case "w": c = "" + d.getDay(); break; c = leftPad(d.getFullYear() % 100);
break;
case "Y":
c = "" + d.getFullYear();
break;
case "p":
c = (isAM) ? ("" + "am") : ("" + "pm");
break;
case "P":
c = (isAM) ? ("" + "AM") : ("" + "PM");
break;
case "w":
c = "" + d.getDay();
break;
} }
r.push(c); r.push(c);
escape = false; escape = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment