hi
yes, i think that i know what is the problem
in this line: $(‘#firstdate .acf-date-picker input.hasDatepicker’).live(“change”, function(e) {
you have to change
acf-date-picker input.hasDatepicker -> acf-date-time-picker input.hasDatepicker
your classes are different when you use the time picker.
Hi
this is the code that i used:
(function($) {
$(‘#firstdate .acf-date-picker input.hasDatepicker’).live(“change”, function(e) {
var getval = $(this).val();
var dataname = $(“#firstdate”).attr(“data-name”);
if (dataname == “fecha_de_llegada”) {
var makedate = $(this).val().split(“/”);
var date = new Date(makedate[1] + “/” + makedate[0] + “/” + makedate[2]);
date.setDate(date.getDate() + 1);
if (!isNaN(date.getTime())) {
var getnew = date.toLocaleDateString(‘en-GB’);
var getmyd = getnew.split(‘/’);
var gyear = getmyd[2].toString();
var gmonth = getmyd[1].toString();
var gday = getmyd[0].toString();
$(“#seconddate”).find(‘input[type=text]’).val(date.toLocaleDateString(‘en-GB’));
$(“#seconddate”).find(‘input[type=hidden]’).val(gyear+gmonth+gday);
} else {
alert(“Invalid Date”);
}
}
});
})(jQuery);
make sure that you change the ID/classes of you element:
#firstdate, #seconddate
hope it helps
I need it to be dynamic – in every post, according to the user, the number of rows changes. so i can’t have a fixed limited row number.
Thanks, I’ll be the first one to buy this extension.
I’m really enjoying working with your plugin , it made wordpress to be a real CMS.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.