purgeTime display #65

Closed
opened 2026-01-19 18:28:49 +00:00 by michael · 2 comments
Owner

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":
Screenshot from 2023-05-17 23-39-47

I have thought of two different approaches:

1. Display only the days without the hours and seconds:
Screenshot from 2023-05-17 23-37-52

2. Display the days, hours and seconds, omitting zero values:
Screenshot from 2023-05-17 23-35-13

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.

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": ![Screenshot from 2023-05-17 23-39-47](https://github.com/dutchcoders/transfer.sh/assets/30585029/9f5a962d-302a-48b2-a537-c08a7ffd9bcc) I have thought of two different approaches: **1. Display only the days** without the hours and seconds: ![Screenshot from 2023-05-17 23-37-52](https://github.com/dutchcoders/transfer.sh/assets/30585029/a8db1636-0200-4b16-8831-5ec56d4c30e0) **2. Display the days, hours and seconds**, omitting zero values: ![Screenshot from 2023-05-17 23-35-13](https://github.com/dutchcoders/transfer.sh/assets/30585029/9f01fd8d-6301-452f-998e-30b373435b28) 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.
Author
Owner

@natilou 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 print X days

Great, I will change it to print X days. Thanks!

@natilou 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 print `X days` Great, I will change it to print `X days`. Thanks!
Author
Owner

@paolafrancesca commented on GitHub:

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.

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 print X days

@paolafrancesca commented on GitHub: > 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. 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 print `X days`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#65