DMXzone Calendar 3 Support Product Page

Show date from database

Reported 29 Mar 2016 08:03:30
1
has this problem
29 Mar 2016 08:03:30 Greta Garberini posted:
Hi,
I need to use an update form with calendar3.
The date should come from a database and populate the calendar3 Initial Date. The date format is German and has to use dd.mm.yy in Date Format of Calendar 3. I believe that this is the equivalent of Data Bindings Date format dd.MM.yyyy, because if I display it as a text output, it correctly shows 01.03.2016. (1st of March 2016)
If I use the black bolt in Calendar3 and bind it to the date field in Databindings it does not come up, even if I use Data Bindings formater. If I test it and put a static value of 01.03.2016 it shows up correctly. The code for Calendar 3 in this sample is:

                <label for="Erscheinungsdatum" class="col-lg-2 control-label">Erscheinungs-Datum</label>
                <div class="col-lg-10">
                  <div class="dmxCalendar2" id="Erscheinungsdatum" value="{{Auslesen.data.Auslesen[0].datum.formatDate( &quot;dd.MM.yyyy&quot; )}}"></div>
<script type="text/javascript">
  // <![CDATA[
 jQuery(document).ready(
   function()
     {
       jQuery("#Erscheinungsdatum").dmxCalendar2(
         {"dateFormat": "dd.mm.yy", "defaultDate": "{{Auslesen.data.Auslesen[0].datum.formatDate( \"dd.MM.yyyy\" )}}", "altField": "hidden_dmxCalendar21", "altFormat": "yy-mm-dd", "displayInline": true, "numberOfMonths": [1, 2], "condDates": [], "firstDay": 1, "showOn": "both", "duration": "slow", "showOptions": {"direction": "up", "easing": "swing"}, "yearRange": "c-10:c+10"}
       );
     }
 );
  // ]]>
</script>
<input type="hidden" id="hidden_dmxCalendar21" name="hidden_dmxCalendar21" value="{{Auslesen.data.Auslesen[0].datum}}" />


What else do I need to change in order to make it work?

This output:

{{Auslesen.data.Auslesen[0].datum.formatDate( "dd.MM.yyyy" )}}


on the page correctly shows:

01.03.2016

Replies

Replied 14 Jun 2017 12:54:31
14 Jun 2017 12:54:31 Greta Garberini replied:
Still not solved.
How to correctly populate an existing date from a database? It's needed for an update scenario.
Has this been answered elsewhere already?
Replied 23 Jun 2017 10:37:07
23 Jun 2017 10:37:07 Greta Garberini replied:
Someone reading this?

Reply to this topic