1

I’m attempting to create a shortcut that uses the input of a the date like 2024-Wk37. I’ve looked at Unicode Technical Standard #37 and a whole host of examples, but I can’t get this to work without procesing the single quotes as part of the date format.

What I want: 2024-Wk37
What I used: YYYY-‘Wk’w
What I get:  2024-‘29’37

enter image description here

1 Answer 1

3

Literal strings in the date format must be quoted with an apostrophe (', Unicode U+0027, aka “single vertical quote”), not with a left single quotation mark (’, Unicode U+2018, aka “typographical quotation mark”). With

YYYY-'Wk'w

you'll get the expected result, for example "2024-Wk37".

Here is the corresponding part from the Unicode #35 Standards: Date Format Patterns (emphasis added):

  • Literal text, which is output as-is when formatting, and must closely match when parsing. Literal text can include:
    • Any characters other than A..Z and a..z, including spaces and punctuation.
    • Any text between single vertical quotes ('xxxx'), which may include A..Z and a..z as literal text.
    • Two adjacent single vertical quotes (''), which represent a literal single quote, either inside or outside quoted text.
2
  • … so a mark not available on my iOS keyboard. How singular. Thanks, you are entirely correct, copying and pasting the right mark worked fine.
    – Aquarion
    Commented Nov 24 at 13:59
  • @Aquarion: Try pressing and holding the single quote key on the iOS keyboard, then you should see a list of variants to choose from, in particular the vertical apostrophe. (I have a German iOS, so things may be different on your device.)
    – Martin R
    Commented Nov 24 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .