yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Change Float to String

Open srakl opened this issue 3 years ago • 2 comments

Code breaks in PHP 8.1+. Have to make offset as string instead of float, otherwise it cannot be used as array key.

Q A
Is bugfix? yes
New feature? no
Breaks BC? yes/no
Tests pass? yes
Fixed issues Fixed this issue #461

srakl avatar Jul 26 '22 18:07 srakl

Thanks for the PR! Are you sure this is sorting as expected? Just quoting a number in string means "12" comes before "2". The number must always have two integer digits, so a leading 0 must be prepended for single units. See SO.

Also, please add a note to the CHANGELOG file.

maxxer avatar Jul 27 '22 03:07 maxxer

Thanks for the PR! Are you sure this is sorting as expected? Just quoting a number in string means "12" comes before "2". The number must always have two integer digits, so a leading 0 must be prepended for single units. See SO.

Also, please add a note to the CHANGELOG file.

Looks ok on my end. "12" is "12" not "2"

here is the HTML

<select id="profile-timezone" class="custom-select custom-select-lg" name="Profile[timezone]">
  <option value="">Select Timezone</option>
  <option value="14">Pacific/Kiritimati (UTC +14)</option>
  <option value="13">Pacific/Tongatapu (UTC +13)</option>
  <option value="12.75">Pacific/Chatham (UTC +12.75)</option>
  <option value="12">Pacific/Wallis (UTC +12)</option>
  <option value="11">Pacific/Pohnpei (UTC +11)</option>
  <option value="10.5">Australia/Lord_Howe (UTC +10.5)</option>
  <option value="10">Pacific/Saipan (UTC +10)</option>
  <option value="9.5">Australia/Darwin (UTC +9.5)</option>
  <option value="9">Pacific/Palau (UTC +9)</option>
  <option value="8.75">Australia/Eucla (UTC +8.75)</option>
  <option value="8">Australia/Perth (UTC +8)</option>
  <option value="7">Indian/Christmas (UTC +7)</option>
  <option value="6.5">Indian/Cocos (UTC +6.5)</option>
  <option value="6">Indian/Chagos (UTC +6)</option>
  <option value="5.75">Asia/Kathmandu (UTC +5.75)</option>
  <option value="5.5">Asia/Kolkata (UTC +5.5)</option>
  <option value="5">Indian/Maldives (UTC +5)</option>
  <option value="4.5">Asia/Tehran (UTC +4.5)</option>
  <option value="4">Indian/Reunion (UTC +4)</option>
  <option value="3">Indian/Mayotte (UTC +3)</option>
  <option value="2">Europe/Zurich (UTC +2)</option>
  <option value="1">Europe/London (UTC +1)</option>
  <option value="0">UTC (UTC 0)</option>
  <option value="-1">Atlantic/Cape_Verde (UTC -1)</option>
  <option value="-2">Atlantic/South_Georgia (UTC -2)</option>
  <option value="-2.5">America/St_Johns (UTC -2.5)</option>
  <option value="-3">Atlantic/Stanley (UTC -3)</option>
  <option value="-4">America/Tortola (UTC -4)</option>
  <option value="-5">America/Winnipeg (UTC -5)</option>
  <option value="-6">Pacific/Galapagos (UTC -6)</option>
  <option value="-7">America/Whitehorse (UTC -7)</option>
  <option value="-8">Pacific/Pitcairn (UTC -8)</option>
  <option value="-9">Pacific/Gambier (UTC -9)</option>
  <option value="-9.5">Pacific/Marquesas (UTC -9.5)</option>
  <option value="-10">Pacific/Tahiti (UTC -10)</option>
  <option value="-11">Pacific/Pago_Pago (UTC -11)</option>
</select>

srakl avatar Jul 27 '22 04:07 srakl