Dynamic variable into javascript variable

I am trying to put a dynamic variable using dmx.parse into a javascript function. The value is a date.

I know that ‘-’ and ‘/’ are a problem in javascript so it needs to be in a string. But even dynamic data passing an integer does not work. If I bind a static date to a variable this works “‘2012/12/31’” with double and single quotes. Any ideas?

<body is="dmx-app" id="test2" onload="test();">

<dmx-value id="testDate" dmx-bind:value="serverconnect1.data.query.dateArr"></dmx-value>
<script type="text/javascript">
                    function test() {
                var test1 = dmx.parse('testDate.value');
document.getElementById("demo").innerHTML = test1;
}
                </script>
                <p id="demo"></p>
Community Page
Last updated: