Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Time calculation - full hours aren't calculated correctly

markush32574551
Level 2
Level 2

Hey,

I have a little issue. I was programming a time calculation (dynamic) table and yesterday everything worked, but today no full hours are calculated correctly.

I tried then to display the hour as a decimal number using following script:

this.rawValue = Time2Num(cellabove.rawValue, "HH:MM", "en_GB")

But this happened and I don't know why. I can repeat it for every full hour.

1472440_pastedImage_0.png

1472459_pastedImage_1.png

All times are entered in text fields, but when I change it to time fields it makes no difference and yesterday it worked with text fields.

I managed to get my script to work yesterday but now it only works for not full hours, what can I do?

var endT  = Left(Timeto_einf, 2) + Right(Timeto_einf, 2) / 60

var startT = Left(Timefrom_einf, 2) + Right(Timefrom_einf, 2) / 60

var breakT = Left(Break_einf, 2) + Right(Break_einf, 2) / 60

$.rawValue = (endT - startT - breakT)

Thank you in advance!

Best regards,

Markus

1 Accepted Solution
markush32574551
Correct answer by
Level 2
Level 2

It needed 6 hours and I thought I it is impossible, but found the mistake:

I just needed to use the .formattedValue and everything works!

Well it's never easy, but always simple...

Still thanks!

Markus

View solution in original post

1 Reply
markush32574551
Correct answer by
Level 2
Level 2

It needed 6 hours and I thought I it is impossible, but found the mistake:

I just needed to use the .formattedValue and everything works!

Well it's never easy, but always simple...

Still thanks!

Markus

View solution in original post