Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Handling JS Date: units consistency #211

Open
spectrolite opened this issue Jul 28, 2017 · 2 comments
Open

Handling JS Date: units consistency #211

spectrolite opened this issue Jul 28, 2017 · 2 comments

Comments

@spectrolite
Copy link

spectrolite commented Jul 28, 2017

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
Copy link
Member

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
Copy link
Author

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 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants