I need to work a date object thru a specific set of circumstances.
- user is inputting a daterange, from/to.
- each date needs to be converted
toISOString()
because that's how it is in the DB. - client wants the dateranges to hard convert to US Pacific time.
So when the user chooses from/to dates, the app is makes their chosen dates in US Pacific timezone, and then searches the db using ISO formatted dates.
I have this SE Post which gets me the timezone conversion, but in a non-iso format. Any attempts at deriving toISOString()
molests the object right back to the device timezone.
I'm trying dayjs(), but it winds up being a bunch of extra steps, only to have the end result be molested to the device timezone.
How can I get the above series of events to unfold in the necessary order?