a1337
a1337
Arts 1337
1 post
Don't wanna be here? Send us removal request.
a1337 · 3 years ago
Text
Notion formula - today date translated
Whether for personal or professional Notion database page we always want to personalize it to our wishes and needs. Here I'm gonna share with you the code I created for my own use so you can have the today date on the fly translated to your language of choice.
The code
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(formatDate(now(), "ddd, DD - MMM"), "Sun", "1"), "Mon", "2"), "Tue", "3"), "Wed", "4"), "Thu", "5"), "Fri", "6"), "Sat", "7"), "Jan", "8"), "Feb", "9"), "Mar", "10"), "Apr", "11"), "May", "12"), "Jun", "13"), "Jul", "14"), "Aug", "15"), "Sep", "16"), "Oct", "17"), "Nov", "18"), "Dec", "19")
How to use the code
After getting the code you'll need to modify it to the language you want. Here is how you can do it:
The part written "ddd, DD - MMM" determines how the date will show up. As it is, the date will be shown like this: Monday, 28 - November. You can change the order or everything just keep in mind that ddd is for the week day, DD is the number of the day and MMM is the month.
For the translation part
Just change the number to fit whatever you want. For example, if you want Sunday to be shown as Ice cream, go to the number that represents Sunday to Ice cream. The number guide:
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
January
February
March
April
May
June
July
August
September
October
November
December
Screenshots of the code working
The first one is the one I use which is on Portuguese.
Tumblr media
The second one is the code with only numbers that I left here so it's easier for people to modify it to the desire language.
The Portuguese one
Since I speak Portuguese, I'll left the code for Portuguese translation here as well.
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(formatDate(now(), "ddd, DD - MMM"), "Sun", "Domingo"), "Mon", "Segunda"), "Tue", "Terça"), "Wed", "Quarta"), "Thu", "Quinta"), "Fri", "Sexta"), "Sat", "Sábado"), "Jan", "Janeiro"), "Feb", "Fevereiro"), "Mar", "Março"), "Apr", "Abril"), "May", "Maio"), "Jun", "Junho"), "Jul", "Julho"), "Aug", "Agosto"), "Sep", "Setembro"), "Oct", "Outubro"), "Nov", "Novembro"), "Dec", "Dezembro")
English version
If you simply want it in English, you can use this basic function for the same effect as the one shown in this post.
formatDate(now(), "dddd, DD - MMMM")
You can experiment with the dddd, DD and MMMM to see what fits your needs. For exemplo, using dddd shows Monday while using ddd shows Mon.
Examples of date formats
Tumblr media
Let me explain a little. "d" is for the week day. 1 will show the number of the day of the week, 2 is not really useful, 3 will show the short version of the name and 4 will show the full name. "D" is for the day of the month. 1 will show the day but if it's an one digit day, like the 9th it will show "9" while with "DD" it will show "09". "DDD" shows the day of the year. "M" is for the month. 1 and 2 will show the number of the month acting the same as the 1 and 2 version of "D". 3 and 4 will show the name of the month acting the same and 3 and 4 of "d". "Y" is for the year. 1 and 4 will show the year. 2 will show you the last 2 digits of the year. 3 is useless because it just shows the 1 and 2 together (for 2022 it shows 222022).
How it works
Using the replace function and a basic function to show the date for today, this code simply replaces stuff from the basic code to whatever you want.
Finishing
If you have any question about this code fell free to message me and I'll be glad to assist you.
2 notes · View notes