App Connect Data Formatter Support Product Page

Solved

days-until does not work for inputs

Reported 31 Jan 2018 10:36:43
1
has this problem
31 Jan 2018 10:36:43 Ben Pleysier posted:
Binding the value of days-until does not work.

Copy the following example into a new document, making sure that the linked files are correct.

Quote<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript" src="dmxAppConnect/dmxAppConnect.js"></script>
<script type="text/javascript" src="dmxAppConnect/dmxFormatter/dmxFormatter.js"></script>
</head>
<body id="myid" is="dmx-app">
<form name="frmMailTracker" id="frmMailTracker" action="">
<input name="day" type="text" dmx-bind:value="today.datetime.daysUntil("2018-01-20""> <!-- does NOT work -->
<p>{{today.datetime.daysUntil("2018-01-20"}}</p> <!-- WORKS -->
</form>
<dmx-datetime id="today" interval="days"></dmx-datetime>
</body>
</html>


You will notice that the content in the paragraph works well while the value for the input field does not.

As a side note, I also cannot use the value of the days-until as a filter in a Data View statement.

Edit: The emicon represents a closing bracket, got wrongly translated by forum module.

Replies

Replied 31 Jan 2018 11:04:21
31 Jan 2018 11:04:21 Teodor Kuduschiev replied:
Hello Ben,
You need to escape the quotes in the dmx-bind:value=" ". You cannot nest quotes in quotes in HTML markup.
so that
dmx-bind:value="today.datetime.daysUntil("2018-01-20")"

becomes

dmx-bind:value="today.datetime.daysUntil(&quot;2018-01-20&quot;)"

This happens automatically when you bind the value using the extension UI, and probably you just copied and pasted this value from somewhere else in the field value.
Replied 31 Jan 2018 11:23:55
31 Jan 2018 11:23:55 Ben Pleysier replied:
Easy! Leaves me red faced once again. Thank you Teodor.

Reply to this topic