strftime does not implement - flag (don't pad a numerical output) #289

Closed
tkrotoff opened this Issue Sep 5, 2012 · 1 comment

Projects

None yet

2 participants

@tkrotoff
tkrotoff commented Sep 5, 2012

Cf http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime

Example:

Time.local(2012, 9, 5, 15, 00).strftime('%a, %B %d, %-l%P')
 => "Wed, September 05, 3pm"
Time.local(2012, 9, 5, 15, 00).strftime('%a, %B %d, %l%P')
 => "Wed, September 05,  3pm"

Under JRuby 1.7.0.preview2 (1.9.3p203) 2012-09-03 b37a0bd (Travis CI):

Time.local(2012, 9, 5, 15, 00).strftime('%a, %B %d, %-l%P')
=> "Wed, September 05,  3pm"

I didn't test the other flags that are available with MRI:

-  don't pad a numerical output.
_  use spaces for padding.
0  use zeros for padding.
^  upcase the result string.
#  change case.
:  use colons for %z.
@tychobrailleur tychobrailleur added a commit to tychobrailleur/jruby that referenced this issue Sep 7, 2012
@tychobrailleur tychobrailleur Apply '-' behaviour to blank padded format directives.
This commit addresses jruby issue #289.  The expected behaviour is documented in this rubyspec pull request: https://github.com/rubyspec/rubyspec/pull/153
6f86d35
@BanzaiMan
Member

I'm closing this one.

@BanzaiMan BanzaiMan closed this Oct 5, 2012
@prathamesh-sonpatki prathamesh-sonpatki added a commit to prathamesh-sonpatki/jruby that referenced this issue Dec 3, 2012
@tychobrailleur @prathamesh-sonpatki tychobrailleur + prathamesh-sonpatki Apply '-' behaviour to blank padded format directives.
This commit addresses jruby issue #289.  The expected behaviour is documented in this rubyspec pull request: https://github.com/rubyspec/rubyspec/pull/153
5ffbeda
@jballanc jballanc pushed a commit to jballanc/rubyspec that referenced this issue Dec 8, 2013
@tychobrailleur tychobrailleur Spec dash behaviour for padded format directives.
Following JRuby issue jruby/jruby#289, it appears
MRI applies '-' to normally padded format directives.  This added spec
documents this behaviour.
067e12f
@eregon eregon added a commit that referenced this issue Aug 22, 2016
@eregon eregon Squashed 'spec/ruby/' changes from b6baa6d..ffdfa41
ffdfa41 fix spec description
763e265 Fix double close in ARGF#read_nonblock spec
34d5bd1 Do not expect stdin to be the standard one in ARGF#read_nonblock
6a4a506 Remove stale comment
d23843f Merge pull request #289 from nobu/bug/fix-spawn
acf7634 ruby_cmd for spawn
6ef8ffc AppVeyor: run on every branch
705f41f windows guard fox unix sockets
ee7ff0e Do not guess a free port but use find_available_port
5258c31 Merge pull request #287 from etehtsea/add-inspec-sockaddr
4ee1776 Correctly pass interpreter arguments and flags in Process#kill specs
bb0c704 Remove most usages of RUBY_EXE and replace by ruby_cmd
22f9a5b Use ruby_cmd instead of RUBY_EXE in popen specs
1f85144 Fix a couple specs assuming RUBY_EXE is only a path without flags
ea5303a Share a few #spawn specs and use ruby_cmd over RUBY_EXE
721e379 Add Addrinfo#inspect_sockaddr spec
981a6e7 Windows seems to pack socket options in a short
0416004 join thread in ObjectSpace.each_object
e061bfe Add windows guard for lgamma
4864e06 Add a few windows guards
d2656bc Some environments seem to not fill the cannoname

git-subtree-dir: spec/ruby
git-subtree-split: ffdfa41f12ce35e1c91dab3a72b95edf4020b3ea
5aee8b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment