Can someone explain to me why the answer for the first one is
" 'Tweeted on a' EEEE 'in' MMMM",
and the second one is
'MMM . dd'
What is the difference between using single quotation mark and double quotation mark here?
If I answer the second task "MMM . dd" using double quotation, I can't pass the task. Then why is the first
task using " is fine?
This doesn't explain in the slides or API documentation. Thanks.
moderator: Sorry to see you had not gotten an earlier response. Probably well too later for you, but I'll put my answer within this post to not add another post and to help any others who come across this and would like to see an answer
What is the difference between using single quotation mark and double quotation mark here?
The entire string contains spaces, so the entire string (the string argument to the date
filter) needed to be enclosed in double quotes (e.g., "'Tweeted on a' EEEE 'in' MMMM"
), and within there, you needed to use different quotes, so the single quotes, to delimit non-date elements like 'Tweeted on a'
. EEEE
is a date element.
It asked you to display the day (e.g., Monday) and the month (e.g., October) both as full english words.
The linked to documentation from the challenge goes to the page that gives examples where you can figure this out.