remove unnessary timezone convertion

This commit is contained in:
Thein Lin Kyaw
2022-04-19 19:40:53 +06:30
parent 3c7fd0aff4
commit 3c5416a154
154 changed files with 321 additions and 321 deletions

View File

@@ -52,14 +52,14 @@ class Transactions::CardSaleTransController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -53,14 +53,14 @@ class Transactions::CardSettleTransController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -75,15 +75,15 @@ class Transactions::OrderReservationsController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]

View File

@@ -37,8 +37,8 @@ class Transactions::SalesController < ApplicationController
@food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")
if @shift.present?
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.strftime("%e %b %I:%M%p")
@shift_data = @shift
end
@@ -183,15 +183,15 @@ class Transactions::SalesController < ApplicationController
period = params[:period]
from = params[:from]
to = params[:to]
day_ref = Time.now.utc.getlocal
day_ref = Time.now
if from.present? && to.present?
f_date = DateTime.parse(from)
t_date = DateTime.parse(to)
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
from = f_time.beginning_of_day.utc.getlocal
to = t_time.end_of_day.utc.getlocal
from = f_time.beginning_of_day
to = t_time.end_of_day
else
case period.to_i
when PERIOD["today"]