Time calculations

Hi guys,

I’ve just started playing with bubble and I’m amazed by the progress I’ve made in a handful of hours. I’ve looked for an answer in the forum but can’t seem to find what I’m looking for. I’m building a staff wage calculator and need to calculate the difference between 2 times (7:30pm to 9:30pm) and I love the air time picker. But, it only seems to let me do calculations on the hours and minutes individually, not the total times. I know there are formulas to work the difference out the long way but I was hoping I could do endtime-starttime without having to do longer calculations. Does anyone know a way to do this?

Thank you in advance.

Does anyone have any suggestions before I go the long way 'round?! Appreciate any input.

Thanks guys

Essentially you can’t do this with the Air Time pickers because they are just Values being returned and not an actual Date format.

You can very easily do this calculation using the built in Date/Time picker or Air Date/Time picker.
Or you can use the Air Time picker and convert a Date to the correct times, then proceed with the difference calculation
Rough example:
Current Date/Time :changehours to Air Time B hours :changeminutes to Air Time B minutes SUBTRACT Current Date/time :changehours to Air Time A hours :changeminutes to Air Time A minutes

2 Likes

Thanks, that’s really useful. I was hoping not to have to use the standard date time plugin as I can’t seem to find a way of getting it to pick only the time. Looks like only date and time. I’ll keep playing!

Thanks again

Hi @jkpuck,
I’m guessing you’re talking about the Air Date/Time dropper and not the Air Date/Time picker.
These are tow different plugins.

Anyway i’ve just updated the Air Date/Time dropper which i think you’re referring to.

The new update now allows the element to return a date object (date value) based on the selected time.
Since this is a time picker the date component is not needed and its always set to Jan 01 1970.
Because the date will always be the same you can do time calculations like subtracting one elements date value from another since its the same day.

Make sure you update your plugin to at least version 1.3.0 to see this new feature.

3 Likes

That’s fantastic! Thank you so much for the update, going to have a play with it right now

Hi @seanhoots

I was wondering if you could help? I love your plugin, its perfect but i’m really struggling with disabling dates on the Date dropper. I have attached a few screenshots but i cant see what im doing wrong. I have a data type called “Disabled Dates” which has a few dates in there, then on the plugin side im just doing a simple search to block them. I have tested this meathod with the date/time picker plugin and works perfectly.Would you mind helping? Thanks
AirDate1

Can you send me a private message with a link to the page so i take a look it?
Maybe something is broken in the plugin because the last time i checked this was working fine.

Hi,

I am trying to calculate the difference between dates and following your advise but I am not making the progress i would like.

Here is a print screen of what I am doing:

image

What do i change the date into??? none of the options I select will work.

Does anyone have any ideas?

Best,

Rachel

1 Like

Just to help anyone who is stuck on this problem and looking for a solution. I got around this by using the format 00:00 in 24 hour military time. Then truncating the value so your left with only hours and then only minutes then doing the calculation. For calculating minutes 60=100 then get a percentage like .25 .5 .75, Which works well for calculating hours total. If there’s a better way let me know because I was stuck on this problem for a couple hours trying to use the values that are given through the provided methods.

how did you end up doing this?

1 Like