Problem with addSeconds formatter

‘00:00:00’.addSeconds(monitor.data.api1.data[id].stats.Uptime).formatDate(‘HH:mm:ss’)

monitor.data.api1.data[id].stats.Uptime int string
Ekran görüntüsü 2022-02-25 093001

Could you check with App Connect from the new Beta channel, date formatters got an update there.

I’ve just updated the Beta versions of App Connect and the Formatters. In the latest Beta bundled with Wappler the date formatters don’t work correctly, here is the fixed version.

dmxAppConnect.zip (25.7 KB)
dmxFormatter.zip (7.5 KB)

Thank you i will test today

… follow…

I am sorry it is unsuccesfull
‘00:00:00’.addSeconds(monitor.data.api1.data[id].stats.Uptime).formatDate(‘HH:mm:ss’)
it wrotes 00:00:00 and there is no console error.

What is monitor.data.api1.data[id].stats.Uptime returning?

returns number

Could you check in the console to following:

dmx.parse("'00:00:00'.addSeconds(123456).formatDate('HH:mm:ss')")

It should return '10:17:36'.

works-fine

INT out of my database.,…

<dmx-value id="timer" dmx-bind:value="'00:00:00'"></dmx-value>

<dmx-value id="addseconds_int" dmx-bind:value="apidatata.data.query1[0].id"></dmx-value>

{{timer.value.addSeconds(addseconds_int.value).formatDate('HH:mm:ss')}} --- this works fine

<br><br>

{{apidatata.data.query1[0].id}} ---> INT out of database<br><br>

<dmx-serverconnect id="apidatata" url="/api/test/test"></dmx-serverconnect>

but you will get this… in the console… *** i have not updated the files above…

The warnings in the console probably only happen at page start when the data from the database wasn’t loaded, it then passes a null/undefined value;

Changing the expression to timer.value.addSeconds(addseconds_int.value || 0).formatDate('HH:mm:ss') should prevent the warning.

1 Like

Worked like a charm :slight_smile:

timerst.value.addSeconds(monitor.data.api1.data[id].stats.Uptime**.toNumber()**).formatDate(‘HH:mm:ss’)

adding “.toNumber()” is solved my problem.