quasarframework / quasar-framework.org

[DEPRECATED, v0.17] Quasar Framework - The Official Website
https://quasar-framework.org
MIT License
110 stars 313 forks source link

Handling JS Date: units consistency #211

Open spectrolite opened 7 years ago

spectrolite commented 7 years ago

http://beta.quasar-framework.org/components/handling-js-date.html

the unit tables sometimes have a plural s, and sometimes not, sometimes day is used, sometimes date.

eg. http://beta.quasar-framework.org/components/handling-js-date.html#Set-date-time milliseconds | for the milliseconds component of the date/time seconds | for the seconds component of the date/time minutes | for the minutes component of the date/time hours | for the hours component of the date/time date | for the day component of the date/time month | for the month component of the date/time year | for the year component of the date/time

http://beta.quasar-framework.org/components/handling-js-date.html#Equality second test if same second only minute test if same minute only hour test if same hour only day test if same day only month test if same month only year test if same year only

http://beta.quasar-framework.org/components/handling-js-date.html#Difference seconds | distance in seconds minutes | distance in minutes hours | distance in hours days | distance in days months | distance in months years | distance in years

...there are others throughout the page.

I understand that the plural is sometimes more appropriate, but when working with the code it's very hard to remember when/where to use plural or not.

Please choose either plural or singular and make it consistent across functions in the docs and code (I confess I haven't checked the source).

Alternatively you could make both plural and singular possible for all functions, and explain it in the docs.

rstoenescu commented 7 years ago

Under the covers, Quasar uses the Date() object, which also has these inconsistencies. But you got a good point, and will improve the wrappers.

spectrolite commented 7 years ago

If you could allow both singular and plural forms for all properties, that would greatly simplify everybody’s work and should also be quick for you to do. The only tricky part remaining would be settling the date/day/dayofweek confusion, but perhaps that could be left mirroring Date() for now. Could a first step in this direction make it to v0.15 maybe ?