Practical guides, tutorials, and insights from years of building web and desktop applications. Check out code examples you can actually use!
Javascript date feature that I could have lived without
Be aware of hidden Javascript features that can break your code before you say “ugh..”. Consider the below code that prints today’s date - const dt = new Date(); console.log("dt: ", dt); // 2019-03-31T13:56:42.552Z All looks good? Let us now create a target date for my payment - it is 1.5 months from now. const dt1 = new Date(2019, 05, 15); console.log("dt1: ", dt1); // 2019-06-14T18:30:00.000Z // well - diff. time-zone causes one day prior // .. but that's ok Don’t mind the day gap, we are just living in the wrong time zone. We are happy with 15-Jun allright. ...