Skip Navigation

[Résolu] Problem with custom format for date and time

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
How to format Types date field with escape character

Solution:
Types supports "%" as escape character instead of "\" forward slash to format the date.

So the proposed solution would be:

[types field='my-date' style='text' format='j. F Y  %o%d G:i'][/types] 

Relevant Documentation:

This support ticket is created Il y a 7 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par toolset-dave Il y a 7 années et 1 mois.

Assisté par: Minesh.

Auteur
Publications
#583262

Hi,

I have a code [types field='my-date' style='text' format='j. F Y G:i'][/types] and if I try to show text "od" (in English "from") between the date and time it would not show correctly ('j. F Y \o\d G:i'). I was formating it by the guidance https://codex.wordpress.org/Formatting_Date_and_Time
It shows another date instead of the word.

#583268

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - Could you please try following code :

[types field='my-date' style='text' format='j. F Y  %o%d G:i'][/types] 

Types use "%" as escaping. We already put a not about this and you can see it when you try to add your field. Please check following screenshot:
=> lien caché

#583296

Thank you Minesh. It works.

Now I see its in date notes, my fault.