var fasoon = fasoon || {}; (function (ns, $) { "use strict"; ns.QuotePriceDatepicker = function () { this.construct.apply(this, arguments); }; var proto = ns.QuotePriceDatepicker.prototype; proto.construct = function () { var picker = $('input.datepicker'); var minYear = new Date; minYear = parseInt(minYear.getYear()) + 1900 - 100; var maxYear = new Date; maxYear = parseInt(maxYear.getYear()) + 1900 - 10; picker.datepicker({ changeMonth: true, changeYear: true, yearRange: minYear + ":" + maxYear }); picker .datepicker( 'option', $.datepicker.regional['de'] ) .datepicker( 'option', 'dateFormat', 'dd.mm.yy' ); picker.each(function () { var calendar = $(this).next(); if (calendar.length && calendar.hasClass('calendar')) { var input = this; calendar.on('click', function () { input.focus(); }); } }); }; })(fasoon, jQuery); jQuery(document).ready(function () { new fasoon.QuotePriceDatepicker(); });