the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
994 stars 120 forks source link

Add AdvancedSearch support for filtering mails before a given date #1606

Closed codiflow closed 3 months ago

codiflow commented 4 months ago

The current implementation of AdvancedSearch only allows filtering of emails which arrived since a given date. As one can easily modify the search string (which for example is since=2024-05-27) to also filter mails which have arrived until a given date we should also add this functionality to the drop down as well to make it easier for users to access this option.

There are some small things to consider before merging this:

  1. Currently { id: -1, name: i18n(prefix + 'ALL') }, filters for all mails. Maybe it would be better to switch to 0 here instead of -1 to have it designed more intuitively like all positive numbers are searches before a given date and all negative numbers are searches until a given date.
  2. The language strings have no prefix (yet) which differentiates between since and before. We should add that (see my comment in the code before let prefix = 'SEARCH/DATE_';)
  3. The corresponding language strings are missing yet because I couldn't find the respective files – would be glad if you could tell me where to find them.
  4. The code has not been tested yet because I've no dev setup in place currently.
the-djmaze commented 4 months ago

The translations can be found here: https://github.com/the-djmaze/snappymail/blob/55b8620186835b333ebf9a79fcd8ab6ca6c1e80c/snappymail/v/0.0.0/app/localization/en/user.json#L61-L67

codiflow commented 3 months ago

Thank you for merging this – I did not have the time yet to adapt the lanugage strings. Thank you for doing that for me 🙏

the-djmaze commented 3 months ago

It's not merged. But i will add your changes