forked from 0x2620/oxjs
change Ox.formatDate so that Ox.formatDate('', "%a, %b %e, %Y")
returns '' and not "undefined, undefined Na, NaN"
This commit is contained in:
parent
7747255ab8
commit
e6f075f88e
2 changed files with 5 additions and 2 deletions
|
|
@ -122,6 +122,9 @@ Ox.formatDate <f> Formats a date according to a format string
|
|||
|
||||
Ox.formatDate = function(date, str, utc) {
|
||||
// fixme: date and utc are optional, date can be date, number or string
|
||||
if (date == '') {
|
||||
return '';
|
||||
}
|
||||
date = Ox.makeDate(date);
|
||||
var format = [
|
||||
['%', function() {return '%{%}';}],
|
||||
|
|
@ -546,4 +549,4 @@ Ox.formatUnit <f> Formats a number with a unit
|
|||
@*/
|
||||
Ox.formatUnit = function(num, str) {
|
||||
return Ox.formatNumber(num, 3) + ' ' + str;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue