Hey there! In this guide, we'll show you how to format and translate dates to Spanish using Xano's no-code tools. This can be super useful if your clients or users are primarily Spanish-speaking, and you want to provide a localized experience.
First things first, we need to format the timestamp stored in Xano's database to a human-readable date format. Let's take a look at how to do that:
Now, your new variable "FormattedDate" will contain the timestamp in a readable format like "Monday, 18th October 2021".
To translate the day names, we'll create a JSON object that maps the English day names to their Spanish counterparts:
Your JSON object should look something like this:
To make the translation process easier, we'll extract the day name from the formatted date:
Now, the "DayKeyInEnglish" variable will contain the day name (e.g., "Monday") matching the format in your translation object.
Finally, we'll use the translation object to replace the English day name with its Spanish counterpart:
After saving and running this sequence, your "TranslatedDate" variable will now contain the date with the day name translated to Spanish (e.g., "Lunes, 18 de octubre de 2021").
And there you have it! You've successfully translated dates to Spanish using Xano's no-code tools. You can easily adapt this approach to translate to other languages or modify the date format as needed.
This transcript was AI generated to allow users to quickly answer technical questions about Xano.
I found it helpful
I need more support