Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi, I have 2 fields Time_from and Time_to.

Say I enter 14:00 in Time_from, what I need is a script that enters the time in the next field(Time_to) plus 1 hour so it would be 15:00

Thanks

No script needed ...only an auto-enter calculation on the Time_to field.

Time_from + 3600

and back at the auto-enter tab, uncheck 'do not replace existing value'. :smile2:

  • Author

Thanks, that works but when it inserts the time in the second field it is like 17:00:00 and what I need is 17:00 (no seconds)

Changing the time format on the field to hh:mm does not do anything.

Any ideas?

It doesn't matter which portions of time reside in a field any more than it does with numbers not having a trailing zero for cents. Those types of issues are handled from the layout level.

In layout mode, select the field and Format > time and specify hhmm and 24-hour. :wink2:

  • Author

Yes, I have done that and it still puts in the seconds!

I may be misunderstanding what you want then. Please check the attachment. The first set shows without layout-level time format as I described. The second set shows it with the formatting.

UPDATE: I may not be clear enough, my apology ...

What if your start time has seconds? Do you want the time truncated to only hours and minutes? Even if you use a calculation such as:

Hour ( TimeStart ) & ":" & Minute ( TimeStart ), the result in the time field (unformatted) will have seconds. And yes, it is inconsistent (something I worked on 6 months back) but I do not know how to make it only put hh:mm in a time field at the data layer.

time.zip

Edited by Guest
Added update

  • Author

Hi, my fields are set the same as your example. when the calculation works it adds the +3600 it inserts the seconds.

Ian

I don't know what to say; it works in my file but not yours? You will need to zip and attach your file or at least show me your field types, the data in the fields and screen shots of how you have the time formatted at the layout level.

If it is working properly in my file but not yours, then something is different and I believe it can only be in those places that I've indicated. :idunno:

  • Author

The field types are the same as yours. You can insert the time manually without the seconds it is only when the calculation inserts the time +3600 that it does it.

Thanks though...

it is only when the calculation inserts the time +3600 that it does it.

Correct. If you manually type:

11 - it will insert the data of 11

11:14 - it will insert the data of 11:14

11:14:22 - it will insert the data of 11:14:22

... and you can format that field to display any way you wish, even as 11:14.

But when a TIME field is set via calculation, or script (no matter the calculation used) then it will include the seconds, even if there aren't any. Only through layout can you omit the seconds from display. This drove me nuts last year trying work with ESS data which was inconsistent and those times were required in a relationship (don't ask) and the ESS side was consistent in always showing seconds but FM wasn't. I meant to file a bug report back then but got side-tracked.

I removed a paragraph when I suggested changing the field to text. If you do that and use a calc such as Hour ( TimeStart ) + 1 & ":" & Minute ( TimeStart ) then you risk breaking your time because, if TimeStart is 24:14, your result will be 25:14. There are other problems as well, such as user typing 11:30 PM (which is legal time). The text calc wouldn't convert it. Yes, you can create convoluted calculation to address the issues (I had to) but I wouldn't recommend it. Overall, change it from display level (format level time)

Edited by Guest
Added paragraph then removed it again.

  • Author

Thanks for that!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.