'Clean up javascript date constructor using toISOstring()
How can I refactor these so toISOstring() can be included alongside the Date constructor. Looking at this makes me feel like each of these should be 1 line of code instead of 2.
const currentConvertedDate = currentDate.toISOString();
const packDate = new Date(orderStatus.StartPack);
const convertedPackDate = packDate.toISOString();
const loadDate = new Date(orderStatus.StartLoad);
const convertedLoadDate = loadDate.toISOString();
const delivDate = new Date(orderStatus.EndDeliv);
const convertedDelivDate = delivDate.toISOString();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
