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.

Help with Time - date calc

Featured Replies

I have a portal that tells me when a task is scheduled - ::Date of task/::Time of Task/::Alarm/::Reminder Time.

::ReminderTime is a calc field see JPEG above:

The calc gets data from the Alarm field see JPEG above:

Which is a value list.

Problem:

As long as I am choosing 5 minutes to 12 hours everything works fine. If I want to set the reminder to 1 + days/weeks before it does not calculate. I have figured out that I need a calc that will set the ReminderTime to a day before at the same time, but, I can not figure out how to set up the calculation.

Help Please!!

Thanks,

Al

If anyone has any suggestions as to how to make this shorter and more efficient pleae tell me. :D

Time_calculation1.jpg

Alarm_Value_List.jpg

Edited by Guest

It looks like you need to add a date element to the Reminder, e.g. make the calculation result in Timestamp. Then you could use something like:

Let ( [

f = Case (

PatternCount ( Alarm ; "Minute" ) ; 60 ;

PatternCount ( Alarm ; "Hour" ) ; 3600 ;

PatternCount ( Alarm ; "Day" ) ; 86400 ;

PatternCount ( Alarm ; "Week" ) ; 604800 )

] ;

Timestamp ( Interview_Date ; Interview_Time ) - GetAsNumber ( Alarm ) * f

)

  • Author

Hi Comment:

Thanks for the quick reply. If I use a timestamp field how do I just get the time to show in the field?

You can format the field to show/not show any date element, by selecting Format > Date... in Layout mode. But I am puzzled: if an interview is scheduled for Dec 7 11:00am, and the alarm is set to "1 week" - what use is showing "11:00am" as the ReminderTime (when it really is "Dec 1, 11:00am")?

  • Author

If the Interviewtime is today at 3 PM, and the remindertime is 30 minutes before I want it to just show the time, not date and time. This is used in a scriptfire script and the remindertime is the field the triggerfield looks at to create the schedule. I guess I need to rework it because as soon as I set the field to TimeStamp from Time I get error messages.

So, I'm not sure what I need to do to fix that problem. Its back to the manual to see. :D

As usual, I appreciate your help and I'll let you know if I solve the scriptfire problem or not.

Al

As there's virtually no conditional formatting in Filemaker, you will need a field with a TEXT result for the display, e.g.:D

Let ( [

f = Case (

PatternCount ( Alarm ; "Minute" ) ; 60 ;

PatternCount ( Alarm ; "Hour" ) ; 3600 ;

PatternCount ( Alarm ; "Day" ) ; 86400 ;

PatternCount ( Alarm ; "Week" ) ; 604800 ) ;

ts = Timestamp ( Interview_Date ; Interview_Time ) - GetAsNumber ( Alarm ) * f

] ;

Case (

f ≥ 86400 ; GetAsDate (ts) ; GetAsTime ( ts ) )

)

  • Author

Scriptfire requires a text field that sets the "Schedule": the date and time of the event. It needs to be formatted:

Once: mm-dd-yyyy hh:mm:ss

I reworked my calculation in this field to:

Case(

IsEmpty(Interview_Time);" ";

"Once:" & " " & Month (Reminder Time) &"-"& Day(Reminder Time) &"-"& Year (Reminder Time) &" "& Hour (Reminder Time) & ":" & Minute (Reminder Time) & ":" & Seconds (Reminder Time)

)

This seems to have solved the problem.

Thanks for that extra case statement that will do the trick.

************************

I tried the new calc and that date comes back as 1/01/0001...::D?:

Edited by Guest

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.