Software Archive
Read-only legacy content
17061 Discussions

How to manipulate date time using cordova with xdk?

Jonathan_S_
New Contributor I
272 Views

Hello, I'm trying to show on display the current date time on an app, but doesn't works...
exist a plugin for android that I can show the current date time?

here is my code:


 

 function d()

{
 var day = new Date();
 
      var resto = day.toUTCString();

        document.getElementById('day').innerHTML = resto;

}

 

and this the HTML line:

 

<div onclick="day()" class="table-thing widget uib_w_41 d-margins" data-uib="twitter%20bootstrap/input" data-ver="1">
                        <label id="day" class="narrow-control label-inline"></label>
                        <input class="wide-control form-control default" type="text" placeholder="Placeholder">
                    </div>

 

0 Kudos
2 Replies
Diego_Calp
Valued Contributor I
272 Views

Hi Jonathan,

It is not a matter of an android plugin, try using jquery to access your label, this way:

$("#day").text(resto);

Regards,

Diego

0 Kudos
Elroy_A_Intel
Employee
272 Views

You onclick should equal "d()" in stead of day()

0 Kudos
Reply