dayOccurrence ( )

Function stats

Average user rating
626
431
9999
Support
FileMaker 10.0 +
Date posted
24 May 2020
Version
1
Recursive function
No

Author Info
 Nolee

3 functions

Average Rating None

author_avatar



 

Function overview

Prototype

dayOccurrence  ( selectDate )


Parameters

selectDate  Target date


Description

Tags:  date  

This function will convert a date to a string representing the occurrence of the date in the month of the target date.

Examples

Sample input

dayOccurrence(7/4/1776)


Sample output

1st Thursday of July 1776

 

Function code

// Converts a date to a string representing the occurrence of the date in the month of the target date

Let ( [

~date = selectDate ;

~dayNo = Day ( ~date ) ;

~weekOccurance = Ceiling ( Day ( ~date ) / 7) ;

~suffix = Case ( ~weekOccurance = 1 ; "st" ; ~weekOccurance = 2 ; "nd" ; ~weekOccurance = 3 ; "rd" ; "th" ) ;

~dayName = DayName ( ~date )

] ;

~weekOccurance & ~suffix & " " & ~dayName & " of " & MonthName ( selectDate ) & " " & Year ( selectDate )

)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/431

    Prototype: dayOccurrence( selectDate )
    Function Author: Nolee (http://www.fmfunctions.com/mid/626)
    Last updated: 24 May 2020
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (30)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Layout  (15)
Interface  (15)
Text  (14)
Variables  (13)
Filter  (12)
Design  (11)
Layout Objects  (11)
Array  (8)