This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidDate(date) { | |
var matches = /^(\d{2})[-\/](\d{2})[-\/](\d{4})$/.exec(date); | |
if (matches == null) return false; | |
var d = matches[1]; | |
var m = matches[2] - 1; | |
var y = matches[3]; | |
var composedDate = new Date(y, m, d); | |
return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Extend Date to have a few extra fatures | |
Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; | |
Date.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |
Date.prototype.dayNames = Date.dayNames; | |
Date.prototype.monthNames = Date.monthNames; | |
Date.prototype.getDayName = function() { | |
return this.dayNames[this.getDay()]; | |
}; | |
Date.prototype.getDayNameAbbr = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Date#strftime(format) -> String | |
* | |
* - format (String): the format string | |
* | |
* Formats the *date* according to the directives given in the *format* | |
* string. Requires a String#interpolate() extension. | |
* | |
* ## Format Components | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>HTML5 boilerplate—all you really need…</title> | |
<link rel="stylesheet" type="text/css" href="css/style.css" /> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
</head> |