Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow to change default filename date format #102

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

ekateiva
Copy link
Contributor

@ekateiva ekateiva commented Nov 23, 2023

This package is helpful not only if you want to open the mail preview immediately, but also to use a default mail driver locally (without preview links popup), keep the files for a day and open when needed. However, for this purpose, the default u (microseconds) date format is not very convenient (also, you can't sort by microseconds).
When the files are kept for longer time, it's easier to sort them by date format like Y-m-d_His. This change would allow users to choose the format they want to.

E.g.
image

vs
image

Also, it's backward compatible, even if users do not update their config file as I used ?? 'u' - the old 'microseconds' format implementation.

Besides that, maybe a better default option would be to use U format, as the timestamp is at least sortable:

u | Microseconds. Note that date() will always generate 000000 since it takes an int parameter, whereas DateTime::format() does support microseconds if DateTime was created with microseconds.
---
U | Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)

@freekmurze freekmurze merged commit 81e35fe into spatie:main Mar 8, 2024
@freekmurze
Copy link
Member

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants