From d613a095e19296d4a49dd3b0dd2bd70069783778 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 1 Nov 2014 22:09:21 +0100 Subject: [PATCH] Add in_current_month? method to the TimeEntry model --- stoptime.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index b9f1b99..ad72525 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -427,6 +427,10 @@ module StopTime::Models ((self.end - self.start) / 1.hour).round(2) end + def in_current_month? + self.end.month == Time.now.month + end + ######### protected