Skip to content

Commit

Permalink
datetime util logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewatson committed Mar 6, 2021
1 parent cc4952e commit 9733b02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protected/src/classes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static function datetime_chunks_to_sql($time) {
// Year must be 4 characters
if($i === 0 && iconv_strlen($unit) !== 4) return false;
// All other units must be 2 characters
if(iconv_strlen($unit) > 2) return false;
if($i !== 0 && iconv_strlen($unit) > 2) return false;
// Left-pad strings that are too short
if($i !== 0) {
$unit = str_pad($unit, 2, '0', STR_PAD_LEFT);
Expand Down

0 comments on commit 9733b02

Please sign in to comment.