Using an API, i can retrieve an orders list from a website.
in this list, i have for each order, the date of presentation.
i need to filter this list for order placed in a specific range, but using the date range i have "bad value for range"
this is how the API present the date:
"date_created"=>"2017-03-08T11:22:00"
This is my code
@lunedi = Date.today.at_beginning_of_week
@martedi = Date.today.at_beginning_of_week + 1
ele_ordini = woocommerce.get("orders").parsed_response
@ele_ordini = ele_ordini.select { |ordine| ordine['date_created'] == lunedi.to_datetime..martedi.to_datetime }
My goal si to filter for order placed in current week, only on Monday and Tuesday
yes, the code must be changed ot fill all Tuesday day until 23:59!! but i can do it after!