Conditions for Date Confusion
-
- Posts: 6
- Joined: Feb 17th, ’23, 05:27
Hello!
I'm trying to create conditions that change the suffix for certain dates, i.e 2nd, 3rd, 4th day.
I can get it to work with one date, like if I do A_DD>3 and then put "th" after it in the text. But then it'll end up putting "th" behind dates that should have "rd" or "nd". How do I do this??
Thanks!
I'm trying to create conditions that change the suffix for certain dates, i.e 2nd, 3rd, 4th day.
I can get it to work with one date, like if I do A_DD>3 and then put "th" after it in the text. But then it'll end up putting "th" behind dates that should have "rd" or "nd". How do I do this??
Thanks!
This script outputs the day of the month in the desired format. Type: Command.
Code: Select all
FormatTime, D,, d
Special := {1: "st", 2: "nd", 3: "rd", 21: "st", 22: "nd", 23: "rd", 31: "st"}
Send, % D . ((S := Special[D]) ? S : "th")
-
- Posts: 6
- Joined: Feb 17th, ’23, 05:27
Thanks so much! This was such a headache.
-
- Posts: 6
- Joined: Feb 17th, ’23, 05:27
Do I put this right after the %A_DD% part or somewhere else?Marko wrote: ↑Feb 18th, ’23, 10:32 This script outputs the day of the month in the desired format. Type: Command.
Code: Select all
FormatTime, D,, d Special := {1: "st", 2: "nd", 3: "rd", 21: "st", 22: "nd", 23: "rd", 31: "st"} Send, % D . ((S := Special[D]) ? S : "th")
What excactly you want to do?
-
- Posts: 6
- Joined: Feb 17th, ’23, 05:27
The text that I'm adding this to says:
"...this __ day of January."
I have the month set up to change automatically, and just want the day to add the "th" or "nd" etc.
I added what you gave me in place of the A_DD and it seems to be working. I'll know if it changes to "nd" on the 22nd.
"...this __ day of January."
I have the month set up to change automatically, and just want the day to add the "th" or "nd" etc.
I added what you gave me in place of the A_DD and it seems to be working. I'll know if it changes to "nd" on the 22nd.
The last line could be
Code: Select all
Send, % “…this “ D . ((S := Special[D]) ? S : "th") “ day of “ A_MMMM “.”
-
- Posts: 6
- Joined: Feb 17th, ’23, 05:27
I got it working, thanks! Now I'm working on trying to get this form to act right