v4 is very nice; I searched to find this answer but was unable to find it.
Where do you change the date, and time formats? Thanks in advanced!
Where do you change the date, and time formats? Thanks in advanced!
Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.
Thank you for your support!
<?php .cf_date_picker2 { allowEmpty:true; timePicker:true; inputOutputFormat:'d-m-Y H:i'; } ?>
datetime::{timePicker: true, format: 'd-m-Y H:i:s'}
datetime::{timePicker: true, format: 'd-m-Y H:i:s', inputOutputFormat: 'Y-m-d H:i'}
my_field_class::{minDate: {date: '01-01-1960', format: 'd-m-Y'}, maxDate: {date: '31-12-1999', format: 'd-m-Y'}}[attachment=3]cfminmax.png[/attachment]
my_field_class::{months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato']}[attachment=5]cfitalian.png[/attachment]
my_field_class::{yearsPerPage: 10}[attachment=4]<!-- ia4 -->cflimityears.png<!-- ia4 -->[/attachment]
my_field_class::{startView: 'decades'}[attachment=6]cfdecades.png[/attachment]
my_field_class::{startView: 'year'}[attachment=2]cfyear.png[/attachment]
my_field_class::{minDate: {date: '01-01-1960', format: 'd-m-Y'}, maxDate: {date: '31-12-1999', format: 'd-m-Y'}, months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], startView: 'decades'}[attachment=0]CF_combined.png[/attachment]
var s_delay = 80; var e_delay = 30; var startDate = ''; var pad = function(str) { str = String(str); return (str.length < 2) ? "0" + str : str; } d = new Date(); d.setDate(d.getDate() + s_delay); var d_month = d.getMonth(); d_month++; startDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear(); var endDate = ''; d = new Date(); d.setDate(d.getDate() + s_delay + e_delay); var d_month = d.getMonth(); d_month++; endDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear();The variables s_delay and e_delay at the beginning are the delays from today for the starting point that the datepicker will be 'open'; and the number of days it will be open. In this case it will be open in 80 days time and allow entries for the following 30 days.
minDate: { date: startDate, format: 'd-m-Y' }, maxDate: { date: endDate, format: 'd-m-Y' }
var s_delay = 80; var startDate = ''; var pad = function(str) { str = String(str); return (str.length < 2) ? "0" + str : str; } d = new Date(); d.setDate(d.getDate() + s_delay); var d_month = d.getMonth(); d_month++; startDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear();and
minDate: { date: startDate, format: 'd-m-Y' }Bob
my_field_class::{minDate: {date: '01-01-1960', format: 'd-m-Y'}, maxDate: {date: '31-12-1999', format: 'd-m-Y'}, months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], startView: 'decades'}
minDate: {date: '01-01-1960', format: 'd-m-Y'}, maxDate: {date: '31-12-1999', format: 'd-m-Y'}, months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], startView: 'decades'
var s_delay = 80; var e_delay = 30; var startDate = ''; var pad = function(str) { str = String(str); return (str.length < 2) ? "0" + str : str; } d = new Date(); d.setDate(d.getDate() + s_delay); var d_month = d.getMonth(); d_month++; startDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear(); var endDate = ''; d = new Date(); d.setDate(d.getDate() + s_delay + e_delay); var d_month = d.getMonth(); d_month++; endDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear();
datetime::{timePicker: true}|#|datetime2::{timePicker: false}once saved the content becomes "Array" and the form fields gets the default settings.
nascita::{minDate: {format: 's-m-Y', date: '01-01-1960', format: 'd-m-Y'}, maxDate: {date: '31-12-1999', format: 'd-m-Y'}, months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], startView: 'decades'}|#|giorno_cerco-te::months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ], days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato']};Two fields with italian translation, but one of this with minDate, maxDate and startView.
new DatePicker('.si_date_picker_factuurinvoer', {pickerClass: 'datepicker_vista', format: 'd-m-Y', inputOutputFormat: 'd-m-Y', allowEmpty: 0, timePicker: 0, timePickerOnly: 0, onClose: berekenvervaldatum, maxDate: { date: factuurinvoermaxdatum, format: 'd-m-Y'}});
var s_delay = 80; var startDate = ''; var pad = function(str) { str = String(str); return (str.length < 2) ? "0" + str : str; } d = new Date(); d.setDate(d.getDate() + s_delay); var d_month = d.getMonth(); d_month++; startDate = pad(d.getDate()) +'-'+ pad(d_month) +'-'+ d.getFullYear();and the following in custom date picker.
minDate: { date: startDate, format: 'd-m-Y' }
format: 'd-m-Y', months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ], days: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado']
<div class="ccms_form_element cfdiv_datetime" id="autoID-e5aede781a010bc0af22f57d36e5c6ca_container_div" style=""><label>Datum*</label><input maxlength="80" size="30" class="art-postcontent::{timePicker: false, format: 'd-m-Y H:i:s', inputOutputFormat: 'd-m-Y H:i'} validate['required'] cf_date_picker" title="" type="text" container_id="0" value="" name="input_datetime_6" />
startView: 'month', format: '%d/%m/%Y %H:%M', months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre' ], days: ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'] , minDate: new Date()
<?php $document =& JFactory::getDocument(); // make sure that MooTools is loaded JHTML::_( 'behavior.mootools' ); $cf_url = JURI::root().'components/com_chronoforms/js/datepicker_moo/'; // you can change the uncommented line here to change the style $datepicker_style = $form->form_params->get( 'datepicker_moo_style', 'datepicker_dashboard' ); $document->addStyleSheet( $cf_url.$datepicker_style.'/'.$datepicker_style.'.css' ); // set the datepicker language $lang =& JFactory::getLanguage(); $tag = $lang->getTag(); if ( !$tag ) { $tag = $lang->getDefault(); } $use_tag = 'en-US'; if ( file_exists( $cf_url.'Locale.'.$tag.'.DatePicker.js' ) ) { $use_tag = $this->tag; } // load the datpicker script files $document->addScript( $cf_url.'Locale.'.$use_tag.'.DatePicker.js' ); $document->addScript( $cf_url.'Picker.js' ); $document->addScript( $cf_url.'Picker.Attach.js' ); $document->addScript( $cf_url.'Picker.Date.js' ); ?>And the Load JS action has this code:
window.addEvent('load', function() { var start_date, end_date; // set up the start datepicker start_date = new Picker.Date($('start_date'), { pickerClass: 'datepicker_dashboard', format: '%Y-%m-%d', allowEmpty: true, useFadeInOut: !Browser.ie }); // set up the end datepicker end_date = new Picker.Date($('end_date'), { pickerClass: 'datepicker_dashboard', format: '%Y-%m-%d', allowEmpty: true, useFadeInOut: !Browser.ie }); // add a check when the end datepicker is opened end_date.addEvent('open', function() { if ( start_date.date != end_date.date ) { end_date.options.minDate = start_date.date; } }); });The setup options here are the default ones used by ChronoForms, you can change them or add others as needed.
end_date.options.minDate = start_date.date;with, for example
end_date.options.minDate = start_date.date.increment('day', 4);
// add a check when the end datepicker is opened end_date.addEvent('open', function() { if ( start_date.date != end_date.date ) { end_date.options.minDate = start_date.date; } }); });
// set up the end datepicker end_date = new Picker.Date($('end_date'), { pickerClass: 'datepicker_dashboard', format: '%Y-%m-%d', allowEmpty: true, useFadeInOut: !Browser.ie }); // add a check when the end datepicker is opened end_date.addEvent('open', function() { if ( start_date.date != end_date.date ) { end_date.options.minDate = start_date.date; } }); });
end_date.addEvent('open', function() { if ( $('start_date').value != $('end_date').value ) { end_date.select(Date.parse($('start_date').value)); } });
if ( start_date.date != end_date.date ) { end_date.select(start_date.date); }
if ( start_date.date != end_date.date ) { end_date.select(start_date.date); end_date.options.minDate = start_date.date; end_date.options.maxDate = start_date.date; }I updated the demo form to this version.
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com