You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.0 KiB
83 lines
2.0 KiB
var EXPO = EXPO || {}; //isolated namespace
|
|
if (EXPO.translator) {
|
|
console.warn('WARNING: EXPO.translator is already defined!');
|
|
} else {
|
|
EXPO.translator = (function () {
|
|
/**
|
|
* private (visible inside this module only) variables
|
|
*/
|
|
/**
|
|
* @type {Object} - module API interafce realization
|
|
*/
|
|
var that = {};
|
|
/**
|
|
* @type {Object} default setting
|
|
*/
|
|
that.opt = {};
|
|
/**
|
|
* dependencies.Place where you can switch on dependencies for module
|
|
* @type {EXPO.common|*} - mostly used in project functions and data (block.common.js)
|
|
*/
|
|
var com = EXPO.common;
|
|
|
|
/**
|
|
* current module general initialization
|
|
* @param {Object} options - options recieved from web page view
|
|
*/
|
|
that.init = function (options) {
|
|
/**
|
|
* default module options
|
|
* @type {Object}
|
|
*/
|
|
this.opt = {
|
|
fromDateId:"id_fr",
|
|
toDateId:"id_to"
|
|
|
|
};
|
|
// settings extending
|
|
$.extend(this.opt, options);
|
|
// begin of initialization
|
|
var self = this,
|
|
opt = this.opt,
|
|
$dateFrom = $(document.getElementById(opt.fromDateId)),
|
|
$dateTo = $(document.getElementById(opt.toDateId));
|
|
$(function () {
|
|
$.datepicker.setDefaults($.datepicker.regional["ru"]);
|
|
|
|
$dateFrom.datepicker({
|
|
dateFormat: 'dd.mm.yy',
|
|
showOn: 'button',
|
|
showOtherMonths: true,
|
|
constrainInput: true,
|
|
onClose: function( selectedDate ) {
|
|
$dateTo.datepicker( "option", "minDate", selectedDate );
|
|
}
|
|
}).inputmask("99.99.9999",{
|
|
showMaskOnHover:false,
|
|
insertMode:false,
|
|
'oncomplete': function () {
|
|
$activeField = this;
|
|
}
|
|
});
|
|
$dateTo.datepicker({
|
|
dateFormat: 'dd.mm.yy',
|
|
showOn: 'button',
|
|
showOtherMonths: true,
|
|
constrainInput: true,
|
|
onClose: function( selectedDate ) {
|
|
$dateFrom.datepicker( "option", "maxDate", selectedDate );
|
|
}
|
|
}).inputmask("99.99.9999",{
|
|
showMaskOnHover:false,
|
|
insertMode:false,
|
|
'oncomplete': function () {
|
|
$activeField = this;
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
};
|
|
return that;
|
|
}());
|
|
}
|
|
|