@@ -104,9 +104,6 class TimeEntry < ActiveRecord::Base | |||||
104 | # these attributes make time aggregations easier |
|
104 | # these attributes make time aggregations easier | |
105 | def spent_on=(date) |
|
105 | def spent_on=(date) | |
106 | super |
|
106 | super | |
107 | if spent_on.is_a?(Time) |
|
|||
108 | self.spent_on = spent_on.to_date |
|
|||
109 | end |
|
|||
110 | self.tyear = spent_on ? spent_on.year : nil |
|
107 | self.tyear = spent_on ? spent_on.year : nil | |
111 | self.tmonth = spent_on ? spent_on.month : nil |
|
108 | self.tmonth = spent_on ? spent_on.month : nil | |
112 | self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil |
|
109 | self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil |
General Comments 0
You need to be logged in to leave comments.
Login now