strautomator / core

Strautomator Core
MIT License
41 stars 5 forks source link

Feature Request: Allow Date Fields to be formatted with options #23

Closed m-arx closed 1 year ago

m-arx commented 1 year ago

Hello,

I would like to use the date in my titles but I don't think the current option suffices.

right now ${dateStart} delivers something like '04/04/2023 16:33h'

I think it would be best to have something like ${dateStart.format('DD-MMM-YYYY HH:mm:ss')} or similar, but with a free format spec.

I believe every language should have a default function for this.

we would be free to use any date or time piece in the automation.

igoramadas commented 1 year ago

@m-arx I'll try a few different options implementing this (without using regex or eval).

zecanard commented 1 year ago

I would love if most fields had some kind of formatting customization, specifically for the units. Some units, like min/mi, are redundant (ie. 8:00/mi is sufficient), while others (cadence, watts/kg) omit the unit altogether. Ideally, I’d like the ability to just hide the provided unit altogether and format it myself.

Then there’s the case of Climbing Ratio: in imperial units, that value is expressed in hundreds of feet per mile, which is hard to make sense of. Multiplying that value by 100 to convert it into feet/mile would make it a lot more meaningful.

igoramadas commented 1 year ago

Option to omit all suffixes coming later this week.

igoramadas commented 1 year ago

Deployed to production: https://github.com/strautomator/web/releases/tag/v23.203.11945

Please let me know if you find any issues with the new "noSuffixes" preference.

zecanard commented 1 year ago

Hi @igoramadas, thank you for implementing this so quickly.

I can see the new setting, but it doesn’t appear to stick. The orange bar at the top doesn’t appear when I tap the toggle, and refreshing the page shows the setting as disabled.

igoramadas commented 1 year ago

Yes I figured it out: https://github.com/strautomator/web/commit/12e413e2a5565fc6f6c77db8a654b54f8b85fce6

Unfortunately I couldn't catch this bug on beta because my dev and beta accounts are synced. So once I enabled it on dev, it also got enabled in beta and I missed it.

Fix will be deployed on Friday.

zecanard commented 1 year ago

Thank you for your work, @igoramadas. I bought a Pro subscription yesterday morning. I didn’t strictly need the features, but I always appreciate a responsive developer, and Strautomator is a great tool. Looking forward to the fix.

igoramadas commented 1 year ago

Thanks for your support, really appreciated :-)

igoramadas commented 1 year ago

Fix deployed now: https://github.com/strautomator/web/releases/tag/v23.204.12240

zecanard commented 1 year ago

I didn’t see a reference to “omit tag suffixes” in the notes, so I got mixed up with another issue.

So it looks like it works, but toggling the switch isn’t enough to apply the setting. You need to toggle a separate setting, which saves both it and ”omit all suffixes.” You can then toggle that second setting back to restore it.

I hope that was clear.

Once the setting is successfully applied, it works as expected for activity tags, but not weather tags. Wind speed, temperature, and humidity all show their suffix.