Skip to content

Do not pad year on the client #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Do not pad year on the client #59

wants to merge 3 commits into from

Conversation

thiemowmde
Copy link
Contributor

This removes the code that pads the year to exactly 11 digits. I do not consider this a breaking change but a bugfix for multiple reasons:

  • Note how the pad function truncated (!) if the given number was longer than the requested number of digits.
  • Note how the pad function was unable to correctly pad to more than 11 digits.
  • Note how nothing of this was ever tested.
  • Padding should, if required, be done in a single place on the server. The PHP parsers are able to understand ISO time strings with any (1 to 16) number of digits for the year.

Bug: T66084

@thiemowmde thiemowmde added the bug label Jan 27, 2015
return ( 1e12 + Math.abs( number ) + '' ).slice( -digits );
number = '' + Math.abs( number );

if ( number.lenght >= digits ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. Done.

@thiemowmde
Copy link
Contributor Author

Resubmitted as #67 and #71.

@thiemowmde thiemowmde closed this Mar 16, 2015
@thiemowmde thiemowmde deleted the padding branch March 16, 2015 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants