Forums

Calender

Savadori 18 Dec, 2019
how to make a wound on the calendar date?
come fare una ferita alla data del calendario?


healyhatman 18 Dec, 2019
What do you mean a "wound"?

And if you want to compare dates on the frontend, CF uses the moment.js libray.
Savadori 19 Dec, 2019
Thanks for the reply

"wound"error of the translation sorry

I created a forum where the user enters a date from the calendar
if data is included between 12/22/2019 and 12/28/2019 a Var ts has a value of 10 else 5

I hope I was able to explain myself

healyhatman 19 Dec, 2019
jQuery(document).on('change', 'input[name="calendar_name"]', function() {
let date = jQuery(this).val();
if(moment(date).isBetween('2019-12-22', '2019-12-28')) {
// Do whatever it is you're doing here
}
}
Savadori 19 Dec, 2019
     jQuery(document).on('change', 'input[name="calendar22"]', function() {
let date = jQuery(this).val();
if(moment(date).isBetween('22-12-2019', '28-12-2019')) {

var ts = 2.50;

}else{
var ts = 5.00;
}

});


op("#tipologia_biglietto").change(function (tipo) {
if (op("#tipologia_biglietto").val () == "Andata & ritorno") {

op('#biglietto').val ('Andata & ritorno');
op('#tassa_di_sbarco').val (ts);

}
else if (op("#tipologia_biglietto").val () == "Solo Andata"){
op('#biglietto').val ('Solo Andata');
op('#tassa_di_sbarco').val (ts);


}
else
{
op('#biglietto').val ('Solo Ritorno');
op('#tassa_di_sbarco').val ('0');

}

}
);
does not work
healyhatman 19 Dec, 2019
Of course not those values are only available there you should do all your functions inside it, and it should also be inside a JavaScript block with the Dom ready option ticked
This topic is locked and no more replies can be posted.