strftime does not implement %-flag in 1.8 mode. #433

Closed
ileitch opened this Issue Dec 8, 2012 · 1 comment

Projects

None yet

2 participants

@ileitch
ileitch commented Dec 8, 2012

jruby 1.7.1 (ruby-1.8.7p370) 2012-12-03 30a153b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_09-b05 [darwin-x86_64]

>> RUBY_VERSION
=> "1.9.3"
>> Time.now.strftime('%b %-d')
=> "Dec 7"
>> RUBY_VERSION
=> "1.8.7"
>> Time.now.strftime('%b %-d')
=> "Dec %-d"
@BanzaiMan
Member

A part of me says, who cares about 1.8?

Just kidding.

So, did #strftime in 1.8.7 get the %-d (and friends) back ported? RubySpec doesn't currently test them. https://github.com/rubyspec/rubyspec/blob/master/core/time/strftime_spec.rb#L257

It's pretty easy to fix.

@BanzaiMan BanzaiMan added a commit that closed this issue Dec 9, 2012
@BanzaiMan BanzaiMan At some point, 1.8 also got the support for '%-d'
where '-' means "drop the leading zero".

Fixes #433.
0ff28f0
@BanzaiMan BanzaiMan closed this in 0ff28f0 Dec 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment