Formatting dates for account invoices in rails time zone

This commit is contained in:
Rob Harrington
2015-12-17 11:34:06 +11:00
parent b004060679
commit e0da49e4df
5 changed files with 7 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ class FinalizeAccountInvoices
job: "FinalizeAccountInvoices",
error: "end_date is in the future",
data: {
end_date: end_date.localtime.strftime("%F %T"),
end_date: end_date.in_time_zone.strftime("%F %T"),
now: Time.zone.now.strftime("%F %T")
}
})

View File

@@ -85,7 +85,7 @@ class UpdateAccountInvoices
job: "UpdateAccountInvoices",
error: "end_date is in the future",
data: {
end_date: end_date.localtime.strftime("%F %T"),
end_date: end_date.in_time_zone.strftime("%F %T"),
now: Time.zone.now.strftime("%F %T")
}
})

View File

@@ -118,7 +118,7 @@ class UpdateBillablePeriods
job: "UpdateBillablePeriods",
error: "end_date is in the future",
data: {
end_date: end_date.localtime.strftime("%F %T"),
end_date: end_date.in_time_zone.strftime("%F %T"),
now: Time.zone.now.strftime("%F %T")
}
})

View File

@@ -31,8 +31,8 @@ class BillablePeriod < ActiveRecord::Base
end
def adjustment_label
begins = begins_at.localtime.strftime("%d/%m/%y")
ends = ends_at.localtime.strftime("%d/%m/%y")
begins = begins_at.in_time_zone.strftime("%d/%m/%y")
ends = ends_at.in_time_zone.strftime("%d/%m/%y")
"#{label} [#{begins} - #{ends}]"
end

View File

@@ -64,8 +64,8 @@
-# %th Bill
-# - enterprise.billable_periods.each do |billable_period|
-# %tr
-# %td= billable_period.begins_at.localtime.strftime("%F %T")
-# %td= billable_period.ends_at.localtime.strftime("%F %T")
-# %td= billable_period.begins_at.in_time_zone.strftime("%F %T")
-# %td= billable_period.ends_at.in_time_zone.strftime("%F %T")
-# %td= billable_period.sells
-# %td= billable_period.trial?
-# %td= billable_period.display_turnover