Date and Time not working properly

Beta 6.15

It’s possible I’m doing something wrong here as I haven’t actually used the Date and Time component before.

I created a Date and Time component and am now trying to set a variable to just the date of that. First of all, in the data bindings for the variable I’m unable to select the data formatter. Clicking it does nothing.

I went ahead and did it in code like so…

But that gives my var2 a null value…

image

You don’t necessarily need to assign to a variable…you can just reference the datetime of the component itself:

<dmx-datetime id="current_date" interval="days" utc="true"></dmx-datetime>

{{current_date.datetime.formatDate('yyyy')}}

EDIT: Or is that what you just tried?

I was just using the variable so I could output it to the console to show the null value. If I copy/paste your code directly it doesn’t show anything on the page.

Hmmm. Strange. I just created a blank project, with AC2, and it all works fine.

Copying here in case you spot something:

Content page:

<!-- Wappler include head-page="layouts/main" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="index" appConnect="local" components="{dmxFormatter:{}}" -->
<dmx-datetime id="current_date" interval="days" utc="true"></dmx-datetime>
<h4 dmx-text="current_date.datetime.formatDate('yyyy-MM-dd')">Heading</h4>
<meta name="ac:route" content="/">

and layout:

<!doctype html>
<html>

<head>
  <script src="/dmxAppConnect/dmxAppConnect.js"></script>
  <base href="/">
  <meta charset="UTF-8">
  <title>Untitled Document</title>

  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.14.0/css/all.css" integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc" crossorigin="anonymous" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="/bootstrap/5/css/bootstrap.min.css" />
  <script src="/dmxAppConnect/dmxRouting/dmxRouting.js" defer></script>
  <script src="/dmxAppConnect/dmxFormatter/dmxFormatter.js" defer></script>
</head>

<body is="dmx-app" id="main">
  <div is="dmx-view" id="content">
    <%- await include(content, locals); %>
  </div>
  <script src="/bootstrap/5/js/bootstrap.bundle.min.js"></script>
</body>

</html>

Are you using Beta 6.15?

Yes

Hmmm. So I created a brand new page and the formatter file wasn’t included. It was missing on the other page as well.

<script src="/dmxAppConnect/dmxFormatter/dmxFormatter.js" defer></script>

Once I add that in the code works, but I still can’t do it via the Data Formats as it doesn’t open. It does open for other things, just not to format the Date and Time variable.

Are you able to open the data formatter?

I’ll be out of the office for a few days, but as I recall, I added it using the GUI without any issues.

I can confirm this. This is happening for me as well. W6 B15 experimental enabled.

1 Like

Have noticed this for a few things recently, having to manually edit the expressions which up until the last few updates were able to be formatted. Will compile a list of them for a Bug Report when I have the time.

1 Like

Please recreate the issue with the debug on and post it in a new bug report topic.

This bug has already been reported here …

1 Like