forked from 0x2620/oxjs
some calendar updates
This commit is contained in:
parent
0cbf31e981
commit
2e3292e9ce
4 changed files with 179 additions and 49 deletions
|
|
@ -72,6 +72,8 @@ Ox.SYMBOLS = {
|
|||
CLOSE: '\u2715', BALLOT: '\u2717', WINDOWS: '\u2756',
|
||||
EDIT: '\uF802', CLICK: '\uF803', APPLE: '\uF8FF'
|
||||
};
|
||||
// local timezone offset in milliseconds
|
||||
Ox.TIMEZONE_OFFSET = +new Date().getTimezoneOffset() * 60000;
|
||||
Ox.TYPES = [
|
||||
'Arguments', 'Array', 'Boolean', 'Date', 'Element', 'Function', 'Infinity',
|
||||
'NaN', 'Null', 'Number', 'Object', 'RegExp', 'String', 'Undefined'
|
||||
|
|
@ -1082,6 +1084,11 @@ Ox.isLeapYear = function(year) {
|
|||
return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
|
||||
};
|
||||
|
||||
Ox.makeDate = function(date) {
|
||||
return Ox.isDate(date) ? date :
|
||||
Ox.isUndefined(date) ? new Date() : new Date(date);
|
||||
};
|
||||
|
||||
/*
|
||||
================================================================================
|
||||
DOM functions
|
||||
|
|
@ -1611,6 +1618,22 @@ Ox.formatDate = function() {
|
|||
>>> Ox.formatDate(new Date("01/03/2000"), "%W")
|
||||
"01"
|
||||
*/
|
||||
|
||||
/*
|
||||
var date, fn, format, utc
|
||||
Array.prototype.slice.call(arguments).forEach(function(arg) {
|
||||
|
||||
});
|
||||
|
||||
var fn = {}, format;
|
||||
[
|
||||
'getFullYear', 'getMonth', 'getDate',
|
||||
'getHours', 'getMinutes', 'getSeconds', 'toString'
|
||||
].forEach(function(f) {
|
||||
|
||||
});
|
||||
*/
|
||||
|
||||
var format = [
|
||||
["%", function() {return "%{%}";}],
|
||||
["c", function() {return "%x %X";}],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue