I just found an unexpected behavior where I have placed a timeStamp (Date
) inside a hidden form field. When submitting the (update) form I made some checks on the document delta (because I only want to update the differences of the editing).
At that point I faced, that the unedited hidden Date
field has been detected as being different.
I broke it down to the following reproduction code:
const date = new Date() // Mon Dec 10 2018 09:42:34 GMT+0100 (Timezone goes here)
const dateStr = date.toString()
console.log(date) // "2018-12-10T08:42:34.388Z"
console.log(new Date(dateStr)); // "2018-12-10T08:42:34.000Z"
Because toString()
converts the date to ISO 8601 with precision to the second.
The dates you are comparing differ by milliseconds.
In this code example: let result = (async (global) => { // other code here (includes await's; thus the async) return 123; })(this); The code works, but the return'ed value is nowhere to be ...
In this code example: let result = (async (global) => { // other code here (includes await's; thus the async) return 123; })(this); The code works, but the return'ed value is nowhere to be ...
I have a cylinder bar chart in AmCharts 4 that uses a darker color scheme. The text color for the labels on the bars is black and is not really showing on darker colors. - I am using the javascript ...
I have a cylinder bar chart in AmCharts 4 that uses a darker color scheme. The text color for the labels on the bars is black and is not really showing on darker colors. - I am using the javascript ...
I'm dealing with a div element that has a generic class with no ID (so I can't use select getElementById or getElementByClass) and I'm trying to select the element by type and field from the following:...
I'm dealing with a div element that has a generic class with no ID (so I can't use select getElementById or getElementByClass) and I'm trying to select the element by type and field from the following:...
How can I set an expiration time on a specific local storage variable? Example: If I have a page disclaimer and once the user clicks "accept" I store a certain variable in the local storage. However ...
How can I set an expiration time on a specific local storage variable? Example: If I have a page disclaimer and once the user clicks "accept" I store a certain variable in the local storage. However ...