Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rocky Meza
committed
Mar 17, 2012
1 parent
6a29def
commit d161568
Showing
2 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>moment.isocalendar.js -- Examples</title> | ||
<script src="../node_modules/moment/moment.js"></script> | ||
<script src="../moment.isocalendar.js"></script> | ||
</head> | ||
<body> | ||
|
||
<article id="example1" class="exemplify"> | ||
<h1>Year month day to ISO week date</h1> | ||
|
||
<section class="example"> | ||
<input type="date" value="2012-03-24"> | ||
<button type="button">Change</button> | ||
<p>Year <span class="year"></span>, Week <span class="month"></span>, Day <span class="day"></span></p> | ||
|
||
<script> | ||
(function(){ | ||
var input = document.querySelector('input') | ||
, button = document.querySelector('button') | ||
|
||
, year = document.querySelector('.year') | ||
, month = document.querySelector('.month') | ||
, day = document.querySelector('.day') | ||
|
||
, updateSpans = function() { | ||
var iso = moment(input.value).isocalendar(); | ||
|
||
year.textContent = iso[0]; | ||
month.textContent = iso[1]; | ||
day.textContent = iso[2]; | ||
} | ||
; | ||
|
||
button.onclick = updateSpans; | ||
})(); | ||
</script> | ||
</section> | ||
</article> | ||
|
||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | ||
<script src="https://raw.github.com/rockymeza/exemplify/master/exemplify.js"></script> | ||
<script> | ||
exemplify.init(); | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.