Forums

DateTime Picker config

serpe76 21 May, 2014
Hello, excuse me for my English but I have translated online. in my form I set

DateTime Picker config format: '% d-% m-% Y ' minDate: new date(). increment (' houre, 48)

I wish only for the Friday, Saturday, Sunday, the date would move to 68 hours while Monday, Tuesday, Wednesday, Thursday 48 hours

grazie mille
GreyHead 21 May, 2014
Hi serpe76,

I'm not sure I understand the logic :-( What are you trying to do here?

Bob
serpe76 21 May, 2014
thanks for the reply, what I want to do is: Monday, Tuesday, Wednesday, Thursday, move the date 48 hours
and only on Friday to move the date of 68 hours, I hope I was clear, thanks
-------
grazie per la risposta, quello che voglio fare è: lunedi, martedi, mercoledi, giovedi, spostare la data di 48 ore
e solo il il venerdi spostare la data di 68 ore , spero di essere stato chiaro, grazie
serpe76 23 May, 2014
nessun suggerimento?
Max_admin 02 Jun, 2014
Hi serpe76,

A bit late answer here, what you need to do is tricky, you need an if statement to check the day and set the config string for the picker, I didn't do it before but I think that the easiest way to do it is to copy the date picket initialization script from the page source then modify the "class" and modify the field class and build a new script using PHP and paste it into a "custom code" action.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
serpe76 09 Jun, 2014
Grazie per avermi risposto l'argomento è difficile per me, mi è stato consigliato di aggiungere questo codice:
<?php
if(date("w")==5){
  // 0 = domenica
  // 1 = lunedì ...
  // 5 = venerdì
  echo "68";
} else {
  echo "48";
}
echo "\")\";"; \\ chiude lo script
?>

 });

Ma non saprei ne dove ne come
-------------------------------
Thank you for having responded to me the argument is hard for me, I was advised to add this code:
<?php
if(date("w")==5){
  // 0 = domenica
  // 1 = lunedì ...
  // 5 = venerdì
  echo "68";
} else {
  echo "48";
}
echo "\")\";"; \\ chiude lo script
?>

 });

But I do not know how and where
Max_admin 11 Jun, 2014
Yes, this is the key element, but you need the full modified, what's the link to your form ?

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
serpe76 11 Jun, 2014
You are very kind to give me an answer but I don't link da give you as not on a private network
Max_admin 13 Jun, 2014
Please send the link using the "contact us" page!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
serpe76 16 Jun, 2014
Ciao Max, non posso fornirti di link in quanto il sito è in una Intranet privata😶
Max_admin 07 Jul, 2014
Hi serpe,

Sorry, this took sometime!

Please add a new textbox to your form, give it the class "cf_date_picker_mod" and then add a "load JS" action and use the code below:

<?php
	if(date("w") == 5){
		$inc = 68;
	} else {
		$inc = 48;
	}
?>
window.addEvent('load', function() {
	new Picker.Date($$('.cf_date_picker_mod'), {
		pickerClass: 'datepicker_dashboard', format: '%d-%m-%Y', allowEmpty: true, useFadeInOut: !Browser.ie, minDate: '<?php echo date('d-m-Y', time() + ($inc * 60 * 60)); ?>'
	});
});


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
serpe76 17 Jul, 2014
Mio salvatore, Grazie, Grazie, Grazie..... funziona alla perfezione.... ma ti voglio fare arrabbiare e ti chiedo volendo aggiungere anche il sabato e domenica nei controlli ??
Provando con la virgola non funziona...
My savior, Thank you, Thank you, Thank you ..... it works perfectly .... but I want to make you angry and ask you if you add even on Saturdays and Sundays in the controls?
Trying with the comma does not work
<?php
  if(date("w") == 5,6,7){
   $inc = 68;
  } else {
   $inc = 48;
  }
 ?>
Max_admin 17 Jul, 2014
Con piacere!🙂
if(date("w") == 5 || date("w") == 6 || date("w") == 7){


Saluti,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.