2Elm.Native.Date.make = function(elm) {
3 elm.Native = elm.Native || {};
4 elm.Native.Date = elm.Native.Date || {};
5 if (elm.Native.Date.values) return elm.Native.Date.values;
7 var Maybe = Elm.Maybe.make(elm);
9 function dateNow() { return new window.Date; }
10 function readDate(str) {
11 var d = new window.Date(str);
12 if (isNaN(d.getTime())) return Maybe.Nothing;
16 var dayTable = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
17 var monthTable = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
18 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
20 return elm.Native.Date.values = {
22 year : function(d) { return d.getFullYear(); },
23 month : function(d) { return { ctor:monthTable[d.getMonth()] }; },
24 day : function(d) { return d.getDate(); },
25 hour : function(d) { return d.getHours(); },
26 minute : function(d) { return d.getMinutes(); },
27 second : function(d) { return d.getSeconds(); },
28 toTime : function(d) { return d.getTime(); },
29 fromTime: function(t) { return new window.Date(t); },
30 dayOfWeek : function(d) { return { ctor:dayTable[d.getDay()] }; }
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list