fix error
This commit is contained in:
parent
0b86a3b205
commit
d910d3d99b
|
@ -81,7 +81,7 @@ class Admin::RulingTimersController < OrbitMemberController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def get_user_timer_data(user, display_name = false)
|
def get_user_timer_data(user, display_name = false)
|
||||||
time_now = DateTime.now.utc.new_offset("+8")
|
time_now = DateTime.now.new_offset("+08:00")
|
||||||
now_year_month = time_now.strftime("%Y/%m")
|
now_year_month = time_now.strftime("%Y/%m")
|
||||||
@start_year_month = params[:start_year_month].present? ? DateTime.parse(params[:start_year_month]).utc : time_now
|
@start_year_month = params[:start_year_month].present? ? DateTime.parse(params[:start_year_month]).utc : time_now
|
||||||
@end_year_month = params[:end_year_month].present? ? DateTime.parse(params[:end_year_month]).utc : time_now
|
@end_year_month = params[:end_year_month].present? ? DateTime.parse(params[:end_year_month]).utc : time_now
|
||||||
|
|
|
@ -35,7 +35,7 @@ class RulingTimerProject
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
before_create do |record|
|
before_create do |record|
|
||||||
time_now = record.created_at || DateTime.now.utc.new_offset(record.time_offset)
|
time_now = record.created_at || DateTime.now.new_offset(record.time_offset)
|
||||||
today_start = DateTime.parse("#{time_now.strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
today_start = DateTime.parse("#{time_now.strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
||||||
today_end = DateTime.parse("#{(time_now + 1.day).strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
today_end = DateTime.parse("#{(time_now + 1.day).strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
||||||
today_project_count = record.class.where(:created_at.gte=>today_start,:created_at.lt=>today_end).count
|
today_project_count = record.class.where(:created_at.gte=>today_start,:created_at.lt=>today_end).count
|
||||||
|
@ -58,7 +58,7 @@ class RulingTimerProject
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def create_time
|
def create_time
|
||||||
convert_datetime(self.created_at.utc).new_offset(self.time_offset).strftime("%Y/%m/%d %H:%m")
|
convert_datetime(self.created_at).new_offset(self.time_offset).strftime("%Y/%m/%d %H:%m")
|
||||||
end
|
end
|
||||||
def users
|
def users
|
||||||
User.where(:id.in=>self.user_ids)
|
User.where(:id.in=>self.user_ids)
|
||||||
|
|
|
@ -47,7 +47,7 @@ class RulingTimerTask
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
before_create do |record|
|
before_create do |record|
|
||||||
time_now = record.created_at || DateTime.now.utc.new_offset(record.time_offset)
|
time_now = record.created_at || DateTime.now.new_offset(record.time_offset)
|
||||||
today_start = DateTime.parse("#{time_now.strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
today_start = DateTime.parse("#{time_now.strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
||||||
today_end = DateTime.parse("#{(time_now + 1.day).strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
today_end = DateTime.parse("#{(time_now + 1.day).strftime("%Y/%m/%d")} 00:00:00#{record.time_offset}").utc
|
||||||
today_task_count = record.class.where(:created_at.gte=>today_start,:created_at.lt=>today_end).count
|
today_task_count = record.class.where(:created_at.gte=>today_start,:created_at.lt=>today_end).count
|
||||||
|
@ -147,7 +147,7 @@ class RulingTimerTask
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def create_time
|
def create_time
|
||||||
convert_datetime(self.created_at.utc).new_offset(self.time_offset).strftime("%Y/%m/%d %H:%m")
|
convert_datetime(self.created_at).new_offset(self.time_offset).strftime("%Y/%m/%d %H:%m")
|
||||||
end
|
end
|
||||||
def users
|
def users
|
||||||
User.where(:id.in=>self.user_ids)
|
User.where(:id.in=>self.user_ids)
|
||||||
|
|
Loading…
Reference in New Issue