2012-12-31 14:14:52 +01:00
|
|
|
/* This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
this repository contains the full copyright notices and license terms. */
|
2013-01-04 21:29:48 +01:00
|
|
|
(function() {
|
|
|
|
'use strict';
|
2012-12-31 14:14:52 +01:00
|
|
|
|
2013-01-04 21:29:48 +01:00
|
|
|
Sao.common = {};
|
2012-12-31 14:14:52 +01:00
|
|
|
|
2013-01-04 21:29:48 +01:00
|
|
|
Sao.common.selection = function(title, values, alwaysask) {
|
|
|
|
if (alwaysask === undefined) {
|
|
|
|
alwaysask = false;
|
|
|
|
}
|
|
|
|
if ((Object.keys(values).length == 1) && (!alwaysask)) {
|
|
|
|
var prm = jQuery.Deferred();
|
|
|
|
var key = Object.keys(values)[0];
|
|
|
|
prm.resolve(values[key]);
|
|
|
|
return prm;
|
|
|
|
}
|
|
|
|
// TODO
|
|
|
|
};
|
2013-01-22 17:13:26 +01:00
|
|
|
|
|
|
|
Sao.common.date_format = function() {
|
|
|
|
// TODO
|
|
|
|
// http://stackoverflow.com/questions/2678230/how-to-getting-browser-current-locale-preference-using-javascript
|
|
|
|
return '%m/%d/%Y';
|
|
|
|
};
|
|
|
|
|
|
|
|
Sao.common.text_to_float_time = function(text, conversion, digit) {
|
|
|
|
// TODO
|
|
|
|
return text;
|
|
|
|
};
|
2013-01-04 21:29:48 +01:00
|
|
|
}());
|