def edit
render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
- @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
+ @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
@time_entry.attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
name
end
+ # Returns the current day according to user's time zone
+ def today
+ if time_zone.nil?
+ Date.today
+ else
+ Time.now.in_time_zone(time_zone).to_date
+ end
+ end
+
def logged?
true
end