Jump to content

Date Snippet - st, nd, rd, th date and next business day


Recommended Posts

Hello,

 

I would like to create a snippet that has options to display today's date and the next business day in this format: Friday, May 10th, 2019.

 

Can anyone help me achieve this or point me to an existing workflow that will work?

 

 

Link to post

This snippet will give you today's date:

 

{date:EEEE, MMMM d, YYYY}

 

You can use the native snippets feature for this, you don't need a workflow.  The docs are a little lacking, though ( https://www.alfredapp.com/help/features/clipboard/dynamic-placeholders/#date-time ) - I had to dig around a bit in the incomprehensible Unicode docs to figure out how to get the day of the week (EEEE).

 

Getting the next business day is trickier.  It wouldn't be hard to get tomorrow except on Fridays, then get Monday, but if you want to take into account local holidays then you'll need to pull in calendar data from somewhere.

 

 

Link to post
17 hours ago, celina said:

I would like to create a snippet that has options to display today's date and the next business day in this format: Friday, May 10th, 2019.

 

Can’t be done with a snippet, AFAIK. You can have “May 10”, but not “May 10th”. Well, you can have “May 10th”, but then you’ll also get “May 2th”…

 

One way or another, some coding is going to be required to do exactly what you want, and it’s not straightforward, either, for the reasons @dfay gave.

 

Working with dates is almost impossible to do perfectly, imo. It’s usually a question of how much incorrectness is acceptable.

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...