Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
4943 Переглядів

I would like to put on my home page a widget that I currently use in the event detail module with the follow code:

<span t-field="event.with_context(tz=event.date_tz).date_begin"  t-options='{"widget": "widgetname"}'/>

Is it possible to set a custom date (i.e. 01.01.2018 00:01 ) instead of event.with_context(tz=event.date_tz).date_begin ?

If that is not possible, instead how could I refer to a specific date event? changing the value event.with_context(tz=event.date_tz).date_begin to something like event.with_context(id=10,tz=event.date_tz).date_begin

Аватар
Відмінити

Which version... ?

To have the event, you can do : request.env['event.event'].browse(10).date_begin

To format it, you can use babel syntax with the options 'format' (in last version), or if you just want to remove second, you can use options 'hide_second'...

Автор

@jke: it is working fine.

Найкраща відповідь

Hi,

You mat try this,

         t-field="event.date_begin" t-field-options='{"format": "dd.MM.yyyy HH:mm"}'> which shows as 01.01.2018 00:01


Cheers !

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
січ. 25
83
0
вер. 22
3682
0
черв. 17
8728
3
черв. 15
26201
2
січ. 25
1031