mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-05 23:12:18 +00:00
purgeTime display #65
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @natilou on GitHub.
Currently the purge time is displayed with the format hours, minutes, seconds. For example, I want to store the files for 30 days, but in the web page shows "Files stored for 720h0m0s":

I have thought of two different approaches:
1. Display only the days without the hours and seconds:

2. Display the days, hours and seconds, omitting zero values:

I know that at the moment transfer.sh only supports days (an int value) for the purge time. If this is always going to be the case, perhaps it would be better to only show the days the files will be stored.
But, if there are plans or ideas to use another duration, such as minutes or seconds, in addition to days, the second approach would be better.
I'm willing to work on this, after deciding which approach to take.
@natilou commented on GitHub:
Great, I will change it to print
X days. Thanks!@paolafrancesca commented on GitHub:
yes, I don't plan to change the resolution of purge days to other than (well ...) days :)
the "human redeable" format of the period is https://github.com/dutchcoders/transfer.sh/blob/main/server/handlers.go#L377
Basically calling
time.Duration.String(), that was the laziest thing to do. we can change that to a custom formatter to just printX days