strftime does not support '-' output specifier
----------------------------------------------

                 Key: JRUBY-4612
                 URL: http://jira.codehaus.org/browse/JRUBY-4612
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.4
         Environment: jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-04 6586) 
(Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
            Reporter: John Firebaugh


$ jruby -e 'puts Time.new.strftime("%-m/%-d/%Y %-I:%M %p")'
%-m/%-d/2010 %-I:41 PM

$ jruby --1.9 -e 'puts Time.new.strftime("%-m/%-d/%Y %-I:%M %p")'
String.java:686:in `charAt': java.lang.StringIndexOutOfBoundsException: String 
index out of range: 20
        from RubyDateFormat.java:159:in `compilePattern'
        from RubyDateFormat.java:143:in `applyPattern'
        from RubyTime.java:276:in `strftime'
        from org/jruby/RubyTime$i_method_1_0$RUBYINVOKER$strftime.gen:-1:in 
`call'
        from CachingCallSite.java:310:in `cacheAndCall'
        from CachingCallSite.java:149:in `call'
        from CallOneArgNode.java:57:in `interpret'
        from FCallOneArgNode.java:36:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from RootNode.java:129:in `interpret'
        from Ruby.java:654:in `runInterpreter'
        from Ruby.java:554:in `runNormally'
        from Ruby.java:396:in `runFromMain'
        from Main.java:272:in `run'
        from Main.java:117:in `run'
        from Main.java:97:in `main'

Compare:

$ ruby1.9 -e 'puts Time.new.strftime("%-m/%-d/%Y %-I:%M %p")'
3/1/2010 1:42 PM


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to