Skip to content

Commit

Permalink
fixed wrong regexp for pomodoros in other timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
reborg committed Jun 23, 2009
1 parent 8e5326b commit ac63dca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/pomodori/extensions/timestamp.rb
Expand Up @@ -2,7 +2,7 @@

class String

TIMESTAMP = /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s-\d{4}$/
TIMESTAMP = /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s[-+]\d{4}$/

def flatten_date
return self[0..9].gsub("-", "") if self.timestamp?
Expand All @@ -18,4 +18,4 @@ def strftime(format)
time.strftime(format)
end

end
end
3 changes: 2 additions & 1 deletion test/pomodori/exensions/timestamp_test.rb
Expand Up @@ -13,8 +13,9 @@ def setup
"2009_05_11 11:06:43 -0500".timestamp?.should be(false)
end

it "extracts the the date" do
it "extracts the date" do
@ts.flatten_date.should == "20090511"
"2009-02-16 05:25:00 +0100".flatten_date.should == "20090216"
end

it "returns empty string if not ts" do
Expand Down

0 comments on commit ac63dca

Please sign in to comment.