diff --git a/app/models/timeable_visit_record.rb b/app/models/timeable_visit_record.rb index 974e785e7..8411ddf66 100644 --- a/app/models/timeable_visit_record.rb +++ b/app/models/timeable_visit_record.rb @@ -20,7 +20,7 @@ class TimeableVisitRecord < ApplicationRecord belongs_to :project def self.build(project_id) - week = TimeableVisitRecord.find_or_create_by!(time: Date.today.cweek, project_id: project_id) + week = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y-%W"), project_id: project_id) month = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y%m"), project_id: project_id) return week, month