Forum Documentation Showcase Pricing Learn more

Time calculations


#1

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.


#2

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

Thanks guys


#3

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


#4

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


#5

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.


#6

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


#7

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


#8

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.