It was missing from both the Events calendar widget and the shortcode [events_cal]. However, I spent a lot of time today and fixed the problem. It had to do with the leading zero in the date. I assume the box would be back all on its own on the 10th!
Here’s the code I added:
Right after this:
for ($semaine = 0; $semaine <= 5; $semaine++) { // 6 semaines par mois
$ret.='<tr>';
for ($journee = 0; $journee <= 6; $journee++) { // 7 jours par semaine
I added this:
/* ***** Added so the days less than 10 (single digit days) would have a box around them ***** */
$myNoJour = $sqldate . '-' . $NoJour;
$myNoJour = str_replace("--", "-0", $myNoJour);
$myNoJour = strtotime($myNoJour);
$myNoJour = date('Y-m-d',$myNoJour);
And then I changed the line:
if ($sqldate . '-' . $NoJour == $cejour) {
To:
if ($myNoJour == $cejour) { // changed the variable from $NoJour to $myNoJour
I also fixed the problem with the timezone. This is hard coded to my timezone but that could be done in code as well.:
//* ***** Added to fix timezone offset problem ***** */
//* ***** Gets the current time for my timezone ***** */
$mycejour = new DateTime($value);
$mycejour ->setTimezone(new DateTimeZone('America/New_York'));
$sqldate = date('Y-m');
$cejour = $mycejour ->format('Y-m-d'); // returns 2016-09-04 = is today's date w/leading zeros
// $cejour = date('Y-m-d'); // returns 2016-09-04 = is today's date w/leading zeros
And while I was at it, I rearranged the year/month navigation above the calendar with this:
/* << */
$ret.='<button data-date="' . date('Y-n', $prev_year) . '" tabindex="0" title="'.sprintf(__('Switch to %s', 'event-post'), date('Y', $prev_year)).'" class="eventpost_cal_bt"> << </button> ';
/* < */
$ret.='<button data-date="' . date('Y-n', $prev_month) . '" title="'.sprintf(__('Switch to %s', 'event-post'), date_i18n('F Y', $prev_month)).'" class="eventpost_cal_bt"> < </button> ';
/* month */
$ret.=$this->NomDuMois[$mois] . '/';
/* year */
$ret.=$annee;
/* > */
$ret.=' <button data-date="' . date('Y-n', $next_month) . '" title="'.sprintf(__('Switch to %s', 'event-post'), date_i18n('F Y', $next_month)).'" class="eventpost_cal_bt"> > </button> ';
/* >> */
$ret.='<button data-date="' . date('Y-n', $next_year) . '" title="'.sprintf(__('Switch to %s', 'event-post'), date('Y', $next_year)).'" class="eventpost_cal_bt"> >> </button> ';
Here’s the test site I’m working on: alg.websitesbylunabug.com You can see the calendar widget there. Looks great!
You have a great plugin!
Leslie
p.s. do you have any documentation for the options on the settings page (event-settings)?