quasar-framework.org icon indicating copy to clipboard operation
quasar-framework.org copied to clipboard

Handling JS Date: units consistency

Open spectrolite opened this issue 9 years ago • 2 comments

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.

spectrolite avatar Jul 28 '17 13:07 spectrolite

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

rstoenescu avatar Aug 03 '17 08:08 rstoenescu

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 ?

spectrolite avatar Sep 22 '17 11:09 spectrolite