Skip to content

Replace newDateAsLocaleTime with newDate

Coung Ngo requested to merge cngo-replace-newDateAsLocaleTime-with-newDate into master

What does this MR do and why?

Replace newDateAsLocaleTime with newDate

newDateAsLocaleTime was first introduced to convert yyyy-mm-dd strings to dates to local time, but with imo a slightly confusing name since if you're unfamiliar with dates you might think "what does locale time mean here?".

Recently, a new function newDate was introduced to wrap around the new Date() constructor while fixing this yyyy-mm-dd bug. newDate is a much clearer name as it just creates a new date object as expected without the historical yyyy-mm-dd bug, so this commit just replaces newDateAsLocaleTime with newDate since they do the same thing and deletes newDateAsLocaleTime so we have one single utility function for creating a new date.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

How to set up and validate locally

Edited by Coung Ngo

Merge request reports

Loading