@kitmi/jacaranda
Version:
JavaScript application framework
45 lines (44 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const _Feature = /*#__PURE__*/ _interop_require_default(require("../Feature"));
const _luxon = require("luxon");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const _default = {
stage: _Feature.default.INIT,
load_: async function(app, options, name) {
options = app.featureConfig(options, {
schema: {
locale: {
type: 'text',
default: 'en'
},
timezone: {
type: 'text',
optional: true
}
}
}, name);
app.i18n = {
...options,
datePlus: (date, duration)=>{
return _luxon.DateTime.fromJSDate(date).plus(duration).toJSDate();
},
dateMinus: (date, duration)=>{
return _luxon.DateTime.fromJSDate(date).minus(duration).toJSDate();
}
};
}
};
//# sourceMappingURL=i18n.js.map