2010-07-02 06:54:49 +02:00
|
|
|
(function($) {
|
|
|
|
$('.field.date input.text').live('click', function() {
|
|
|
|
var holder = $(this).parents('.field.date:first'), config = holder.metadata();
|
2010-07-12 08:57:41 +02:00
|
|
|
if(!config.showcalendar) return;
|
2010-07-02 06:54:49 +02:00
|
|
|
|
|
|
|
if(config.locale && $.datepicker.regional[config.locale]) {
|
|
|
|
config = $.extend(config, $.datepicker.regional[config.locale], {});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Initialize and open a datepicker
|
|
|
|
// live() doesn't have "onmatch", and jQuery.entwine is a bit too heavyweight for this, so we need to do this onclick.
|
|
|
|
$(this).datepicker(config);
|
|
|
|
$(this).datepicker('show');
|
|
|
|
});
|
|
|
|
}(jQuery));
|