Better product time selection for supplier products view
This commit is contained in:
@@ -86,7 +86,8 @@ module Suppliers
|
||||
end
|
||||
|
||||
def preview_products
|
||||
@time = Time.parse(params[:date]) rescue Time.now
|
||||
#TODO: time zone correction, since the hour and minute are of the supplier time zone, not the system time zone
|
||||
@time = Time.parse("#{params[:date]}T#{params[:hour]}:#{params[:minute]}:00") rescue Time.now
|
||||
product_categories = ProductCategory.for_supplier_in_time(current_supplier, @time)
|
||||
render json: {categories: product_categories.map(&:to_client_format).select(&:present?)}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user