smartcalc icon indicating copy to clipboard operation
smartcalc copied to clipboard

Customize format of date/time output

Open joshdcurry opened this issue 2 years ago • 0 comments

Could you add a configuration option that allows the user to specify the format for the date/time output from a calculation? Sometimes different levels of detail are needed in the date/time output. A few examples are below.

1. Configuration option for setting the date/time output format

Current output start = 5/29/2022 | May 29 start + 1 day | May 30

Desired output if date_format = %A %D start = 5/1/2022 | Sunday 05/01/22 start + 1 day | Monday 05/02/22

Desired output if date_format = %A %m/%d/%Y start = 5/1/2022 | Sunday 05/01/2022 start + 1 day | Monday 05/02/2022

Desired output if date_format = %A %Y start = 5/1/2022 | Sunday 2022-05-01 start + 1 day | Monday 2022-05-02

2. It also would be great if the app would automatically set the output date/time format based on the input date/time format.

Current output start = Sun 5/1/2022 | May 29 start + 1 day | May 30

Desired output if input date/time as below start = Sun 5/1/2022 | Sun 05/01/2022 start + 1 day | Mon 05/02/2022

Desired output if input date/time as below start2 = Sunday May 1, 2022 | Sunday May 1, 2022 start2 + 1 day | Monday May 2, 2022

Rust docs https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html

https://rust-lang-nursery.github.io/rust-cookbook/datetime/parse.html#display-formatted-date-and-time

joshdcurry avatar May 29 '22 15:05 joshdcurry