Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2842 Widoki

Hi,

I want to patch memoized const exported function of js file (like luxonToMomentFormat in @web/core/l10n/dates).

How can i do that?
Note: i tried the usual patch and did not work.

Awatar
Odrzuć

Can you please share the patching code you tried?

Najlepsza odpowiedź

Hi,

You could try the below mentioned method to patch js.
/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { luxonToMomentFormat } from "@web/core/l10n/dates";

patch(luxonToMomentFormat, 'module_name.luxonToMomentFormat', {
    start() {
        return this._super();
    }
});

Hope it helps

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 24
2690
0
kwi 23
1669
0
mar 15
2893
2
lip 24
2844
1
lis 24
4881