-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(filesystem): customizable timestamp formats #1614
Conversation
Co-authored-by: pynappo <[email protected]>
I've added the changes you suggested @pynappo. On second thought, I think its better to use Thanks for the suggestions! |
I'm thinking of adding relative timestamps as a builtin feature that can be enabled by specifying: default_component_configs = {
last_modified = {
relative = true
}
} Or perhaps like this: default_component_configs = {
last_modified = {
format = "relative"
}
} Or even just include a commented-out implementation of a relative timestamp function in Any opinions about this? Should this be in its own PR? |
Personally I'm leaning towards format = "relative". Commented out implementation would work as well. I think it can be bundled in with this PR. Separately is okay too if you don't want to do that rn. |
Make the timestamp format in the file details popup properly fall back to the format used in the file explorer. Co-authored-by: pynappo <[email protected]>
All done! I've added the suggested changes. |
Any updates on this @pynappo? |
72793f0
to
9900647
Compare
Apologies, had to think about the best way to reduce the amount of configuration needed. I've decided to remove the fallback of file_details's timestamps on the component configs because I think it should always default to giving a detailed absolute time. I also added |
I've added a
format
field in the configs for the componentslast_modified
andcreated
so that users can change the format string used to display timestamps in the file explorer. The field also accepts a function that returns a string so that features like relative timestamps can be implemented. The change is also applied to the file details popup window.Here's an example setup:
The columns are offset in the image because the the timestamp is longer than the column heading. I'll be opening a separate pull request that deals with that.