Skip to content

Commit

Permalink
Time#getlocal(nil) should act like no-arg. Fixes #2310.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 15, 2014
1 parent fc05939 commit 8fe3ae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyTime.java
Expand Up @@ -428,7 +428,7 @@ public RubyTime getlocal() {

@JRubyMethod(name = "getlocal", compat = RUBY1_9, optional = 1)
public RubyTime getlocal19(ThreadContext context, IRubyObject[] args) {
if (args.length == 0) {
if (args.length == 0 || args[0].isNil()) {
return newTime(getRuntime(), dt.withZone(getLocalTimeZone(getRuntime())), nsec);
} else {
Matcher tzMatcher = TIME_OFFSET_PATTERN.matcher(args[0].toString());
Expand Down

0 comments on commit 8fe3ae7

Please sign in to comment.