MomentJs not working on mobile browser on device

Hello, any idea why this code is working fine on desktop (also simulating the mobile version) but instead returns invalid date on a real mobile device?

Desktop app

Same text in a mobile device
image

The code is pretty simple

{{ moment(var_recapEndDate.value).subtract(12, 'months').format('MMM YYYY') }} - {{ moment(var_recapEndDate.value).format('MMM YYYY') }}

doesn't matter if I write a date directly instead of using a variable, like moment('12-01-2024').subtract(12, 'months').format('MMM YYYY') the result is the same. If instead, I don't pass anything to moment, like moment().subtract(12, 'months').format('MMM YYYY') it works fine.

I'm using the new multipage app, @Isabella_Borkovic maybe another related bug?

hello,
@Pennatool

Using the ISO 8601 format (YYYY-MM-DD) is universally supported and avoids ambiguity.

{{ moment('2024-12-01').subtract(12, 'months').format('MMM YYYY') }}

uses the MM-DD-YYYY format, which can lead to inconsistencies, as date parsing behavior varies between browsers and devices, especially on mobile.

Alternative Solution:

{{ moment('12-01-2024', 'MM-DD-YYYY').subtract(12, 'months').format('MMM YYYY') }}

see screenshot