Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
2824 Visninger

How to set my date default value as 05/08/2022??

Avatar
Kassér
Bedste svar

You can do it as below:

my_date = fields.Date(string='My Date', default=lambda self: fields.Date.context_today(self).replace(day=8,month=5,year=2022))

Avatar
Kassér
Forfatter

It's working, where we can define the specific date format like DD/MM/YYYY

You can change it from Languages, Enable developer mode then Go to Settings -> Translations -> Languages -> open your language and edit the date format field to %d/%m/%Y

Forfatter

I tried the same but date showing 2022-05-08

You need to refresh the page. Which screen you check it?

Related Posts Besvarelser Visninger Aktivitet
1
jun. 25
1673
3
jul. 25
3301
1
maj 25
1441
1
maj 25
1700
4
maj 25
2853