From 8395c5c367aedac8b50f069fe62368144860166f Mon Sep 17 00:00:00 2001 From: Yuriy Date: Wed, 8 May 2024 13:59:06 -0400 Subject: [PATCH] generate date ordinals function --- General-Functions.ahk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/General-Functions.ahk b/General-Functions.ahk index ec8bdb2..835f6f2 100644 --- a/General-Functions.ahk +++ b/General-Functions.ahk @@ -594,6 +594,11 @@ CheckIfUpdateInstalled(PassedInArgument :=""){ } } +; https://www.autohotkey.com/boards/viewtopic.php?t=59936 +GetDateOrdinalSuffix(D) { + Static Special := {1: "st", 2: "nd", 3: "rd", 21: "st", 22: "nd", 23: "rd", 31: "st"} + Return D . ((S := Special[D]) ? S : "th") +}