Home Forums ACF PRO ACF Datepicker issue Reply To: ACF Datepicker issue

  • Hi John,

    thank you for your response. I have fixed this issue with ->

                    $date_from  = get_field( 'retreat_date_from' );
                    $date_to    = get_field( 'retreat_date_to' );
                    $date_1     = new DateTime(date('Y-m-d', strtotime($date_from)));
                    $date_2     = new DateTime(date('Y-m-d', strtotime($date_to)));
                    $days       = $date_1->diff($date_2)->days + 1;
                     // var_dump($days, $date_from, $date_to, $date_1, $date_2);
                     // var_dump(strtotime(get_field('retreat_date_to')));
                  <div class="uk-card-body uk-padding-small">
                    <span class="location-card"><?php the_field('retreat_location'); ?></span>
                      <a href="<?php echo the_permalink(); ?>"><h3 class="uk-card-title uk-margin-remove-bottom"><?php echo $days; ?> Tage <?php the_title(); ?></h3></a>
                      <p class="uk-margin-remove-top"><?php echo date_i18n('j F', strtotime($date_from)); ?> - <?php echo date_i18n('j F Y', strtotime($date_to)); ?></p>