RubyDateFormat.java does ont handle %R specifier in strftime
------------------------------------------------------------
Key: JRUBY-3698
URL: http://jira.codehaus.org/browse/JRUBY-3698
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1.6
Environment: Found this on Kubuntu linux, but source code was simply
missing needed code
Reporter: James Britt
The Time class should allow for foratting time using a "%R" specifier, which
produced hours and minutes separated by a colon.
JRuby was ignoring this formattng string. Here is a patch:
---
src/org/jruby/util/RubyDateFormat.java | 5 ++
diff --git a/src/org/jruby/util/RubyDateFormat.java
b/src/org/jruby/util/RubyDateFormat.java
index bfdc6b5..39c66dd 100644
--- a/src/org/jruby/util/RubyDateFormat.java
+++ b/src/org/jruby/util/RubyDateFormat.java
@@ -196,6 +196,11 @@ public class RubyDateFormat extends DateFormat {
case 'p':
compiledPattern.add(new Token(FORMAT_MERIDIAN));
break;
+ case 'R':
+ compiledPattern.add(new Token(FORMAT_HOUR));
+ compiledPattern.add(new Token(FORMAT_STRING, ":"));
+ compiledPattern.add(new Token(FORMAT_MINUTES));
+ break;
case 'S':
compiledPattern.add(new Token(FORMAT_SECONDS));
break;
--
1.6.3.1
--
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