[Catalyst-commits] r14314 - trunk/site
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Sat Jun 30 20:49:01 GMT 2012
Author: t0m
Date: 2012-06-30 20:49:01 +0000 (Sat, 30 Jun 2012)
New Revision: 14314
Modified:
trunk/site/index.html
Log:
Cleanup whitespace and month names
Modified: trunk/site/index.html
===================================================================
--- trunk/site/index.html 2012-06-30 18:32:35 UTC (rev 14313)
+++ trunk/site/index.html 2012-06-30 20:49:01 UTC (rev 14314)
@@ -170,49 +170,49 @@
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
- function parseISO8601(str) {
- // we assume str is a UTC date ending in 'Z'
+ function parseISO8601(str) {
+ // we assume str is a UTC date ending in 'Z'
- var parts = str.split('T'),
- dateParts = parts[0].split('-'),
- timeParts = parts[1].split('Z'),
- timeSubParts = timeParts[0].split(':'),
- timeSecParts = timeSubParts[2].split('.'),
- timeHours = Number(timeSubParts[0]),
- _date = new Date;
+ var parts = str.split('T'),
+ dateParts = parts[0].split('-'),
+ timeParts = parts[1].split('Z'),
+ timeSubParts = timeParts[0].split(':'),
+ timeSecParts = timeSubParts[2].split('.'),
+ timeHours = Number(timeSubParts[0]),
+ var _date = new Date;
- _date.setUTCFullYear(Number(dateParts[0]));
- _date.setUTCMonth(Number(dateParts[1])-1);
- _date.setUTCDate(Number(dateParts[2]));
- _date.setUTCHours(Number(timeHours));
- _date.setUTCMinutes(Number(timeSubParts[1]));
- _date.setUTCSeconds(Number(timeSecParts[0]));
- if (timeSecParts[1]) _date.setUTCMilliseconds(Number(timeSecParts[1]));
+ _date.setUTCFullYear(Number(dateParts[0]));
+ _date.setUTCMonth(Number(dateParts[1])-1);
+ _date.setUTCDate(Number(dateParts[2]));
+ _date.setUTCHours(Number(timeHours));
+ _date.setUTCMinutes(Number(timeSubParts[1]));
+ _date.setUTCSeconds(Number(timeSecParts[0]));
+ if (timeSecParts[1]) _date.setUTCMilliseconds(Number(timeSecParts[1]));
- // by using setUTC methods the date has already been converted to local time(?)
- return _date;
-}
-var monthLookup = {
- 0: "Jan",
- 1: "Feb",
- 2: "Mar",
- 3: "Apr",
- 4: "May",
- 5: "Jun",
- 6: "Jul",
- 7: "Aug",
- 8: "Sep",
- 9: "Oct",
- 10: "Nov",
- 11: "Dec"
-};
- $.getJSON("http://api.metacpan.org/release/Catalyst-Runtime?callback=?", {
+ return _date;
+ }
+ var monthLookup = {
+ 0: "January",
+ 1: "Febuary",
+ 2: "March",
+ 3: "April",
+ 4: "May",
+ 5: "June",
+ 6: "July",
+ 7: "August",
+ 8: "September",
+ 9: "October",
+ 10: "November",
+ 11: "December"
+ };
+ $.getJSON("http://api.metacpan.org/release/Catalyst-Runtime?callback=?", {
format: "json"
- }, function (data) {
- var date = parseISO8601(data.date);
- var verStr = data.version + " - " + date.getDate() + " " + monthLookup[date.getMonth()] + " " + date.getFullYear();
+ }, function (data) {
+ var date = parseISO8601(data.date);
+ var verStr = data.version + " - " + date.getDate() + " " + monthLookup[date.getMonth()] + " " + date.getFullYear();
$('#catalyst_version').html(verStr);
- });
+ });
</script>
</body>
</html>
+
More information about the Catalyst-commits
mailing list