Timesheet calculator

#1

I have made myself a calculator that will add up hours on a timesheet. It is limited in a couple of ways. It needs to use the 24h format (but I actually like that part) and I am just using 4 digit numbers rather than time values (can you use time values in shortcuts?). I always bill to the 1/2 hour where my real problem lies. If I enter 1330 for 1:30pm it won’t calculate the hours properly so instead my workaround for now is to enter 1350. I would be happy if there was a way to round this up in the shortcut. The Round number command does not appear to round to the nearest 50. Find and replace almost works excep of course when I enter 1300. Maybe a regular expression to find the last two digits but I am way out of my depth at this point. Any suggestions would be welcome.

Thans

0 Likes

#2

Can you share your solution so far? Shortcuts has an action to calculate time between dates, and it can round up too.

0 Likes

#3

https://www.icloud.com/shortcuts/558ea4d43c674ec6be1d8aa8bada30f5

I use a dictionary for input and then calculate using the input. The date action may be better though. Thanks

0 Likes

#4

Why is there no date/time option for dictionaries? You can get a date from ask for input but the dictionary is ideal for how I want to input times.

0 Likes

#5

Dictionaries are plain text behind the scenes anyway, so it doesn’t really make all that much difference in the end as far as I can tell. I think the data types (with the exception of dictionary itself) are just a convenience factor. But maybe they’ll add date/time in the future?

You could still ask for input as a date/time and then set a new key in the dictionary to the value of that. It would still be valid.

0 Likes