Home › Forums › Front-end Issues › Manipulating datepicker data › Reply To: Manipulating datepicker data
Elliot
No I haven’t used yymmdd as we need the day of the week to show too. Can I, using the entered data (DyyMd), “reconstruct” it as yymmdd and use that in the get_posts function?
Code now
<?php
$date = get_field('course_date');
// $date = WED2013NOV6 (23/11/1988)
// extract Y,M,D
$D = substr($date, 0, 3);
$y = substr($date, 3, 4);
$m = substr($date, 7, 3);
$d = substr($date, 10, 2);
// create UNIX
$time = strtotime("{$d}-{$m}-{$y}");
// format date (23/11/1988)
?>
<div class="calendar">
<p class="calendarDate"><span class="dow"><?php echo $D; ?></span>
<span class="day"><?php echo $d; ?> <br /><?php echo $m; ?></span>
<span class="year"><?php echo $y; ?></span>
</p>
</div>
Cheers
Pete
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.