Fix The 32 Date Bug For WordPress Sites
THE ISSUE Occasionally the Wordpress event plugin will duplicate the last day of the month and add on an extra day. For example, December 31 is converted to December 32. Note: The strangest piece is that it only occurs on some devices and is not consistent. For example, two different people using the same type of device with the same browser may see different results. Some mentioned this occasionally happens after a time change & may be due to some miscalculations within the plugin.
THE SOLUTION
Since the bug only happens on some devices and the Gregorian calendar never has 32 days in a month & the best solution is to find all dates with 32 and replace with last day in the month, so no data is lost.
THE CODE
Open events-row-details.php and add this script at the bottom of the file.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
console.log('replace any dates with 32 with 31');
$( ".event-day:contains('32')" ).text( "31" );
});
</script>