updates to url controller, filter and form elements
This commit is contained in:
parent
170fd84c80
commit
07c79ed7ac
7 changed files with 162 additions and 79 deletions
|
|
@ -278,16 +278,20 @@ Ox.parseDate = function(str, utc) {
|
|||
var date = new Date(0),
|
||||
defaults = [, 1, 1, 0, 0, 0],
|
||||
values = /(-?\d+)-?(\d+)?-?(\d+)? ?(\d+)?:?(\d+)?:?(\d+)?/.exec(str);
|
||||
values.shift();
|
||||
values = values.map(function(v, i) {
|
||||
return v || defaults[i];
|
||||
});
|
||||
values[1]--;
|
||||
[
|
||||
'FullYear', 'Month', 'Date', 'Hours', 'Minutes', 'Seconds'
|
||||
].forEach(function(part, i) {
|
||||
Ox['set' + part](date, values[i], utc);
|
||||
});
|
||||
if (values) {
|
||||
values.shift();
|
||||
values = values.map(function(v, i) {
|
||||
return v || defaults[i];
|
||||
});
|
||||
values[1]--;
|
||||
[
|
||||
'FullYear', 'Month', 'Date', 'Hours', 'Minutes', 'Seconds'
|
||||
].forEach(function(part, i) {
|
||||
Ox['set' + part](date, values[i], utc);
|
||||
});
|
||||
} else {
|
||||
date = null;
|
||||
}
|
||||
return date;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -548,6 +548,7 @@ Ox.formatValue = function(num, str, bin) {
|
|||
/*@
|
||||
Ox.formatUnit <f> Formats a number with a unit
|
||||
@*/
|
||||
Ox.formatUnit = function(num, str) {
|
||||
return Ox.formatNumber(num, 3) + ' ' + str;
|
||||
Ox.formatUnit = function(num, str, dec) {
|
||||
dec = Ox.isUndefined(dec) ? 3 : dec;
|
||||
return Ox.formatNumber(num, dec) + (str == '%' ? '' : ' ') + str;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue