3

I'm working on a photos app that lets you filter photos based on date range. When a user selects the "Date" filter, two calendars appear and from there they are able to pick a (to and from) date range.

What dates do date pickers normally default to?

I'm thinking the From should default to "the earliest possible date" (ie - when the user signed up essentially), and To defaults to the current date.

Is there a standard for this?

1

When you have a filter control like this one, you're providing the user a tool that they can wield at their own will. If you were to look at the data, perhaps you could find a pattern as to what a user is most likely to choose, but I bet you wouldn't find one clear use case.

Then, if you can't pick a sensible default based on how your users will use the control, the default should cause the least pain possible. Typically I find this to be a Principle of Least Surprise situation. So I'd recommend you pick today's date. Nobody probably wants today's date, but nobody will be surprised by it either.

The date they signed up, while a good thought, I suspect would be more confusing to someone that's been a member more than a month or so.

Also today's date would be (slightly) more optimized for recent dates rather than old dates - if I had to pick between those two, recent is what I'd pick.

3
  • Thanks @Mark D. The problem if we default both From and To to today's date is that once they activate this filter, since today's date is active on both fields, then it'll narrow down the search results immediately. That means that if they don't have any photos for today, then results will automatically be empty?
    – Beans
    Jun 10 '20 at 20:58
  • Or perhaps both can default to today's date, but it doesn't actually return results. It'll return results only after you've selected custom dates in the calendar?
    – Beans
    Jun 10 '20 at 20:59
  • Right, you certainly could also just not have any default values there, also a reasonable approach.
    – Mark D
    Jun 10 '20 at 21:04
0

This depends a lot on the type of data you want to filter.

For analytics, the default is usually the last 7 days. For photos, files I think it can be usually 1 month. It will be good if you have some data related to this. How may photos your users take per day? Why do they filter photos per date?

Per example, my phone is grouping my photos pe month and is creating a monthly album with photos, which I kind of like it.

0

Consider to not use a calendar date picker.

Take a step back and try to figure out how people are going to use this filter. How far back are they likely to choose the "from" date? If this can be years, a date picker can make that very inconvenient. Is it a possibility that users just want to select a year and not be bothered with selecting a month and a day too? In that case consider using select boxes for years, months and days and provide the option "any" for each. You can make "any" the default, but I would recommend to collect data from it and adjust the default value after a while when it is clear what values are used most. If the years select box gets very long, it can also be a number input.

For the "to" date this is slightly different. Still you want to use select boxes to keep it consistent, but there is no "any" option as that makes no sense here. The default can be the current date, if that is mostly wanted. But you can also add a checkbox to choose a different date than today and keep the select boxes disabled until the checkbox is checked. That way you can provide an easy way to only select (or enter) a year and leave month and day the default. The default values can be: current year or last year, January 1st or December 31st, it depends on the needs.

To take it a step further, you can also offer some presets. If a pattern shows that users just want to select past year or month to filter, why not give them that option directly? You can add options like "Past three months", "Last year", "This week" etc. Add a select box (or radio buttons) with presets for the most commonly used periods and offer an extra option to choose a different date. When choosing a different date it will show/enable the select boxes as explained above.

Is there a standard for this?

No, it all depends on the context and user. I think the overall message is that you should know why this filter exists and what date ranges users are going to filter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.