KnotKnick
02/27/2023, 1:32 PMvar deliveryDateFrom = format.format({
value: new Date(urlParams.custpage_delivery_date_from),
type: format.Type.DATE
});
var deliveryDateTo = format.format({
value: new Date(urlParams.custpage_delivery_date_to),
type: format.Type.DATE
});
var deliverydatefilter = search.createFilter({
name: 'shipdate',
operator: 'within',
values: [deliveryDateFrom, deliveryDateTo]
});
objSearch.filters.push(deliverydatefilter);
The issue I am having is when I format the dates obtained from urlParams
using format.format
, the dates I am obtaining is one day behind the dates entered by the users. For example: user enters range of 6/15/2022 to 6/18/2022
, after using format.format
on those dates, I receive 6/14/2022 to 6/17/2022
. What is the issue with my code?Anthony OConnor
02/27/2023, 5:01 PMAnthony OConnor
02/27/2023, 5:09 PMnew Date
objects client side with the values from the user.
and take the startDate.valueOf()
and for end date, and then pass those ints as params instead.
and then recreate your date objects with the ints without the use of the format moduleKnotKnick
02/27/2023, 8:13 PMbattk
02/28/2023, 1:53 AMbattk
02/28/2023, 1:54 AMbattk
02/28/2023, 1:54 AMbattk
02/28/2023, 1:56 AMbattk
02/28/2023, 1:56 AMKnotKnick
02/28/2023, 2:27 PMbattk
03/01/2023, 6:01 AM