MarcThink Posted November 24, 2020 Share Posted November 24, 2020 Hi all! 👋🏻 I'm trying to get relative dates to format as ordinal numbers for a particular day. I currently have {date +7d:long} which gives me, for e.g., December 1, 2020, instead of December 1st, 2020, which is what I need (I'm trying to work with Roam Research which needs ordinal formatting to link things!).Thanks in advance for any assistance! (I've checked out this page and done some google-fu finding only stuff that's currently too advanced for me like this.) Link to comment
deanishe Posted November 24, 2020 Share Posted November 24, 2020 Hi @MarcThink, welcome to the forum. Can’t be done with {date:…} macros, I’m afraid. The Unicode date formats that Alfred uses don’t support English ordinal suffixes. You'll need to write or find a script if you want to add st/nd/rd/th to dates. Link to comment
MarcThink Posted November 27, 2020 Author Share Posted November 27, 2020 (edited) Thanks @deanishe! Guess I'm going to have to be patient as I pick up coding and tackle this in a bit + do manually for now. Edited November 27, 2020 by MarcThink Link to comment
jmsv Posted May 11, 2021 Share Posted May 11, 2021 @MarcThink were you able to figure this out? Stumbled here for the exact same usecase—metadata snippets for Roam Research Link to comment
deanishe Posted May 11, 2021 Share Posted May 11, 2021 Making dates with ordinal numbers is fairly straightforward to do. I can't help until somebody explains what's supposed to happen with them, though. You can't just add a new placeholder macro to Alfred, so you need to describe what kinds of ordinal dates you need to put where and how. If you just want a snippet that inserts the current date with an ordinal for the day, that's easy. Link to comment
Willster Posted July 3, 2023 Share Posted July 3, 2023 This thread has been dormant for a while, but I still have this issue. I'd like a date snippet in Alfred to output today's date in Roam Research in the following format: [[July 3rd, 2023]] Is this possible? @deanishe you seemed to suggest it might be. 🙏 Link to comment
sepulchra Posted July 4, 2023 Share Posted July 4, 2023 (edited) @Willster you are looking for dynamic placeholders and want this one {date:long} and you can just put your wiki formatting around it in your snippet. Here is an example: Edited July 5, 2023 by sepulchra Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now