@@ -210,7 +210,7 class TimelogController < ApplicationController | |||
|
210 | 210 | |
|
211 | 211 | def edit |
|
212 | 212 | render_403 and return if @time_entry && !@time_entry.editable_by?(User.current) |
|
213 |
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => |
|
|
213 | @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today) | |
|
214 | 214 | @time_entry.attributes = params[:time_entry] |
|
215 | 215 | |
|
216 | 216 | call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry }) |
@@ -224,6 +224,15 class User < Principal | |||
|
224 | 224 | name |
|
225 | 225 | end |
|
226 | 226 | |
|
227 | # Returns the current day according to user's time zone | |
|
228 | def today | |
|
229 | if time_zone.nil? | |
|
230 | Date.today | |
|
231 | else | |
|
232 | Time.now.in_time_zone(time_zone).to_date | |
|
233 | end | |
|
234 | end | |
|
235 | ||
|
227 | 236 | def logged? |
|
228 | 237 | true |
|
229 | 238 | end |
General Comments 0
You need to be logged in to leave comments.
Login now