Would you please consider adding type="week" to Datatime component? We need a possibility to select a whole week, like here:
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_week
This could be a very unique addition. I know Germans also reference weeks, and it's a step above saying "The week of monday the 26th of June".
I wonder how many other countries speak in terms of "weeks" too?
Scott
I think it's rather a business type specific requirement. We serve some automotive companies (not from Germany yet) and they use week numbers for delivery planning.
And also input type="week" is actually in HTML5 specification so hopefully it is not so unique requirement and it will be useful not only for us :)
thanks! Longin
Yes. It's is definitely more a business thing. Thanks for pointing that out.
Scott
Another issue with weeks is how you define it. Some countries start a week on Sunday while others start on Monday.
Plus, you also have to consider how the week is reflected at the change of the year. Do you allow partial weeks? i.e. first week in 2017 and last week in 2017. Do you reflect weeks by year and week number?
Just some thoughts on the subject. There will have to be some configuration options that are specific to the week type.
A lot of people already spent their time defining all this for us, and you can see a pretty good explanation here: https://en.wikipedia.org/wiki/ISO_week_date
the info below is to be taken with a grain of salt and probably partially inaccurate, but gives a rough idea of the spread of Monday-first vs Sunday-first throughout the world:
https://www.reddit.com/r/MapPorn/comments/35hb3a/first_day_of_the_week_in_different_countries/
Thanks @spectrolite for the useful links. I am aware that there are standards for much of this.
My comment was to point out that when it comes to implementing a "week" type into a DateTime component, there is more to consider and it's not as straight-forward as one might think. The user's perspective with regards to the UI is different for this compared to something like a selection list component.
Yes, for i18n the day to start the week is important. Saturday can also be the first day of the week in some Islamic countries like Saudi Arabia.
Scott
The day to start the week is configured with 'monday-first' boolean prop. Default is Sunday.
Thanks Razvan. I think this is now two different suggestions. One to have a possibility to have Saturday as the day to start a week.
http://chartsbin.com/view/41671
And the other is to have a week selection for q-datetime or q-datetime-range, whichever fits best.
I'll make a second issue for Saturday. [edit done] https://github.com/quasarframework/quasar/issues/644
Scott
according to http://beta.quasar-framework.org/components/handling-js-date.html#Format-for-display
we can format a date using ww or simply w if you don't need 0-padding to output the week of year.
We can also get it like this date.getWeekOfYear(anyDay)
but we have no way to specify a date by year + week
more specifically, week is absent from
addToDate()
subtractFromDate()
adjustDate()
which all accept already :
-milliseconds
-seconds
-minutes
-hours
-days
-month
-year
ok a week is just 7 days so it's not a big issue, but why not add week for added convenience ?
and week would be greatly useful in isSameDate (which would essentially mean "happens on the same week", pretty useful), and also as a unit in
startOfDate
endOfDate
And for the last two, knowing which day is the first day of the week is indeed important.
cf #759
Once we have all that, we are well armed to think, code and manipulate dates in terms of weeks.
It also makes a lot of sense to extend the Datetime Range component UI to accept a fixed-range prop, that automatically sets to = from + fixedRange as soon as the start date is picked.
Obviously we'd like range-size to take any arbitrary or even dynamic value.
The op's request of having
a possibility to select a whole week
would now be trivial to implement, along with thousands of other use cases.
request moved to #760
Will enhance.
It would be also great to display the week number in calendar. In Norway it is the most common way how people addressing dates - "Tuesday, Week N 36"
It would be also great to display the week number in calendar. In Norway it is the most common way how people addressing dates - "Tuesday, Week N 36"
+1 from Denmark and Sweden, this is used all the time, in busines, in schools, everywhere. So a week display in the picker-pop-up would really be great...
Something like this:

Paging @hawkeye64
@nothingismagick Interesting I never saw the notification on this.
Close this issue - please follow up in unified #5052