I have an ACF date field (same format as post date) and in my Query I want it to be compared to the publish date of the post: If erstelldatum is not empty use erstelldatum for order If erstelldatum is empty use publish date for order instead Order descending My code is working so far but the order isn`t right. It lists all posts with erstelldatum first followed by those without. I want them to be ordered descending by the …
Somehow, the default jQuery UI Datepicker (loaded by domain/wp-includes/script-loader.php on line 214 in version 4.7 is giving javascript errors in the console. This is the line that loads in the file: $scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.4', 1 ); And here is the error: edit.php:81 GET http://jquery-ui.googlecode.com/svn/tags/latest/ui/i18n/jquery.ui.datepicker-nl.js?ver=4.7 It returns with an 404. How do I fix this error? I have searched within the wp-admin and wp-includes files, but I just can't figure out why this error is present. IMPORTANT: I don't …
I've added support for datepicker on date fields in entry detail edit admin page of Gravity Forms. I did this by simply enqueuing the gform_datepicker_init script in admin_enqueue_scripts hook. This works perfectly as datepicker is displayed for date fields which was not available by default in entry detail edit page. My form has additional requirements and I want to limit the dates in a datepicker field. So, for that I want to take advantage of a JS filter gform_datepicker_options_pre_init provided …
I'm trying to figure out if there is a way to have multiple dates on a form be filled by the first date. I have 14 dates on the form. I want the user to pick the date on the first date and have the remaining dates autofill but cascading so it'll be two weeks of dates. I have no idea if this is possible.
I have a form where i would like to add a datetimepicker(). I must be doing something wrong. I have done the following: In my header.php <?php wp_enqueue_script("jquery"); ?> In my functions.php wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css'); In my template.php <form id="" name="" action="<?php echo get_permalink(); ?>" method="post"> <input type="text" id="MyDate" name="MyDate" value=""/> <input type="submit" value="Submit" name="submit"> </form> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#MyDate').datepicker({ dateFormat : 'dd-mm-yy' }); }); </script> Here is the error: Uncaught TypeError: jQuery(...).datepicker is not a function I see …
Need to add category to custom post type entries after a date from an acf date picker field has passed. I found the following code which almost does the same thing. The difference is that it sets the expired post to draft instead of adding a category. // Expire events if ($expireTransient = get_transient($post->ID) === false) { set_transient($post->ID, 'set for 1 minutes', 1 * MINUTE_IN_SECONDS ); $today = date('Ymd', current_time('timestamp', 0)); $args = array( 'post_type' => 'ausstellung', 'posts_per_page' => 200, …
In a totally custom page, written as a PHP snippet using Woody Snippets plugin, I need to use a jQuery datepicker to select a date. I imported the necessary files correctly, and also called and set up the datepicker correctly. Yesterday, I attached the datepicker to a hidden input field, so that when I clicked on an icon, the calendar would float in place, and everything was fine, even the localization, although I hadn't taken any measures for the localization …
I have two date fields where I want to make sure the "end date" is always later than the "start date". I added a validation function per ACF's documentation. It does fire, but the custom message does not display next to the field. It only says "validation failed" on the top. add_action('acf/validate_save_post', 'my_acf_validate_save_post'); function my_acf_validate_save_post() { $start = $_POST['acf']['field_5fb0e816ea4fc']; $start = new DateTime($start); $end = $_POST['acf']['field_5fb0e83aea4fd']; $end = new DateTime($end); // check custom $_POST data if ($start > $end) { …
It's a sad day in the world when I Google something and it returns nothing. I am trying to use the default datepicker (or ANY datepicker at this point) and am unable to because of my lack of knowledge with Wordpress/PHP. In my plugin, I am attempting to register jquery and the ui and apparently am breaking other parts of WordPress in the process. Can someone please tell me what I'm doing wrong and if they can provide a working …
I am using Min and Max date in the Elementor Form. The Min and Max date are working fine but When I add the Date Format, the Min & Max date is not working and Date Format is working. My Min & Max Date Code Added In functions.php: add_action( 'wp_footer', function() { ?> <script type="text/javascript"> jQuery( window ).load( function( $ ){ var limitFlatPicker; var afterTwoDays; var afterEightDays; limitFlatPicker = limitFlatPicker || {}; limitFlatPicker = { defaultSettings: { selector: '.flatpickr-input', minDate: …
Hey guys im trying to get the jQuery datepicker working for the admin section for a custom post type. Essentially I just want a date and then the ability to store that date in the DB then query the DB to pick things like the month. For now I just want the datepicker ui to start working and then I can work on adding the data to the DB. So i first added a jquery stylesheet and the jqueryui script …
i am using ACF to display an internationalized date with this code : <?php $dateformatstring = "l j F Y"; $unixtimestamp = strtotime(get_field('date')); ?> <?php echo date_i18n($dateformatstring, $unixtimestamp); ?> but i wish i could separate each part into span for example to obtain a result like this : <span>*day number*</span><span>*week day*</span><span>*month*</span><span>*year*</span> but despite many attemps, i couldn't make it -_- Thanks for your help ;-)
I have a custom post type Event that I use in conjunction with ACF. I have a group called event and inside that group I have a field called date_start. And this is the code that I currently have, but it filters instead of sorts, meaning every past event is not visible. $args = array( 'post_type' => 'events', 'posts_per_page' => '-1', 'meta_query' => array( array( 'key' => 'event_date_start' , 'compare' => '>=', 'value' => current_time('Ymd'), ) ), 'meta_key' => 'event_date_start', …
Hello i am using the CMB2-toolkit for Wordpress: https://github.com/CMB2/CMB2/wiki/Field-Types I have a Problem where i have 2 Datetimes, where one is the Starting-Time and the other is the Ending Time. Here is a picture how it looks in the Unserinput and in the Backend: Now i would like to have an validate, when i have set the Event-End before the Event-Begin then i should be warn me like the attributes or parameter-fields "required=>" or "min=>" (https://github.com/CMB2/CMB2/wiki/Field-Parameters). I try to fix …
I want to use the datepicker that gets bundled with WordPress on the front end of a website. I enqueued jquery-ui-datepicker but the datepicker isn't styled(no js error in console). Is there a corresponding wp_enqueue_style for that? I used this code in functions.php function rr_scripts() { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery' ) ); wp_register_style( 'bootstrap_css', get_template_directory_uri() . '/assets/css/bootstrap.min.css' ); wp_enqueue_style( 'bootstrap_css' ); # I'm using Twitter Bootstrap as CSS(if it matters) } add_action( 'wp_enqueue_scripts', 'rr_scripts' );
I am using Advanced Custom Fields in my WordPress project. In it I have added 2 datepickers as custom fields for pages. Now the main problem is whenever I add a new page both datepickers by default show up empty, but I want to set the current date of the server as a default, that is whenever I add a new page both the date pickers should have the current date of the server by default in it. In advance …
On my site I load datepicker.min.js <script type='text/javascript' src='http://xxx/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4'></script> <script type='text/javascript' src='http://xxx/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.11.4'></script> <script type='text/javascript'> jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Fermer","currentText":"Aujourd\u2019hui","monthNames":["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],"monthNamesShort":["Jan","F\u00e9v","Mar","Avr","Mai","Juin","Juil","Ao\u00fbt","Sep","Oct","Nov","D\u00e9c"],"nextText":"Suivant","prevText":"Pr\u00e9c\u00e9dent","dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["dim","lun","mar","mer","jeu","ven","sam"],"dayNamesMin":["D","L","M","M","J","V","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});}); </script> So I wish to add a datepicker to my input <input type="text" class="mkdf-filter-min-date" name="min_date" placeholder="Check-in:" value="<?php echo esc_attr( $today ) ?>"/> But i don't find how to do.
I've added a new date field on the checkout page. I'd like to create a date based delivery fee calculation. The date field has the 'update_totals_on_change' class. When changing this manually the totals is recalculated as expected. Unfortunately when I use the jQuery datepicker on this field the totals not updating. In my opinion, I should trigger the update_checkout method in the datepicker's callback. In the WooCommerce checkout.js script there's a input_changed(); which fires the $( 'body' ).trigger( 'update_checkout' );. …
I was looking for a datepicker, I read in another question's answer that jQuery UI's DatePicker is included in WordPress. To make it work I needed to add in script inclusions wp_enqueue_script('jquery-ui-datepicker'); But now it's missing .css, I tried to add this in styles inclusions wp_enqueue_style('jquery-ui-datepicker'); but it didn't work. In the WordPress I'm working on, I found however thousands of references for datepicker. In the end I'm using this for now: wp_enqueue_style( 'jquery-ui-datepicker', plugin_dir_url(__DIR__) . 'jetpack/modules/contact-form/css/jquery-ui-datepicker.css' ); But I …