@genexus/web-standard-functions
Version:
GeneXus JavaScript standard functions library for web generators
24 lines • 921 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.time = exports.timeImpl = exports.time_format = void 0;
/**
* To return the time in the 'hh:mm:ss' format.
* @return String
*/
var time_format;
(function (time_format) {
time_format[time_format["format_12"] = 12] = "format_12";
time_format[time_format["format_24"] = 24] = "format_24";
})(time_format || (exports.time_format = time_format = {}));
const gxdatetime_1 = require("../types/gxdatetime");
const timeImpl = (tf, date) => {
let format = tf === time_format.format_12 ? "en-US" : "en-GB";
return (date || new gxdatetime_1.GxDatetime()).toLocaleTimeString(format);
};
exports.timeImpl = timeImpl;
const time = () => {
// TODO get timeformat from app preferences
return (0, exports.timeImpl)(time_format.format_12, new gxdatetime_1.GxDatetime());
};
exports.time = time;
//# sourceMappingURL=time.js.map