Date
object was introduced in ECMAScript 1 in 1997.
Among others it has methods for getting Date
parts.
In my opinion methods naming are somewhat confusing.
-
getDate()
returns day of month, notDate
as name says. -
getDay()
returns day of week, which is not obvious from the name.
The idea is to rename these methods to more appropriate naming, reflecting its intention.
I propose getDate()
to be renamed to getMonthDay()
or getDayOfMonth()
or even getDayPart()
.
Accordingly getDay()
to be renamed to getWeekDay()
or getDayOfWeek()
or even getWeekDayPart()
.
I'm not native English speaker, so one might propose better names. The idea is to make these names closer to their semantics.
Of course, for backward compatibility 'old' methods must not be deleted but marked deprecated instead as it was with pair getYear()
/ getFullYear()
.