diff options
| author | mo <mo.khan@gmail.com> | 2017-08-28 21:12:45 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-08-28 21:12:45 -0600 |
| commit | b73a1e38ff4ed8d57ce388c303e77ed1beeff776 (patch) | |
| tree | 761cab8df41acb01f091c3b65896daee597beb14 /app | |
| parent | 1fed3df7f0a8ce50f8496b7006e6ea9b2bb1ba2c (diff) | |
convert to user preferred locale.
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/csv/workout.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/csv/workout.rb b/app/models/csv/workout.rb index f876b7a..6a2534f 100644 --- a/app/models/csv/workout.rb +++ b/app/models/csv/workout.rb @@ -21,7 +21,9 @@ class Csv::Workout end def self.map_from(row, user) - workout = new(date: Date.strptime(row[0], "%m/%d/%y"), note: row[1], body_weight_kg: row[2], body_weight_lb: row[3]) + date = user.time_zone.local_to_utc(Date.strptime(row[0], "%m/%d/%y").to_time) + + workout = new(date: date, note: row[1], body_weight_kg: row[2], body_weight_lb: row[3]) # skip additional exercises for now row[4..-1].take(3 * 8).each_slice(8) do |slice| workout.exercises << Csv::Exercise.new( |
