Bug in get_next_available_time
-
Hi, I noticed that the next available time on our site is not accounting for GMT offset. I looked at the following code in DateTimePicker.php and think there is a bug:
public function get_next_available_time( $opts ) {
$tzoffset = get_option( ‘gmt_offset’ );
$tzoffset = strpos(‘-‘, $tzoffset) ? ‘-‘ . $tzoffset : ‘+’ . $tzoffset;
…
}From what I can tell the strpos line is unnecessary, since $tzoffset already has a minus sign (e.g. here in Edmonton time zone the result of the get_option call is -6).
Also the order of the strpos parms are backwards (it is needle, haystack but should be the opposite). The time is correct if I comment out this line.
- The topic ‘Bug in get_next_available_time’ is closed to new replies.