Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Displaying Current Date/Time using a user control

I create a new user control "datetime"

in the markup I have

<script type="text/javascript">
var dt = new Date();
document.getElementById("datetime").innerHTML = dt.toLocaleString();
</script>


How do i create the label to display the "datetime"?

I just want the date and time to display at the top of the dashboard.
2 people have
this question
+1
Reply
  • I worked around the datetime display by replacing the page header with a business rule.

    Showing Date In place of specificed "Page Header" on Dashboard

    Add a Business Rule in the Dasboards Controller

    Type : JavaScript
    Command Name: Select
    View: form1
    Phase: After

    Script:
    var d = new Date,
    dformat = [d.getMonth()+1,
    d.getDate(),
    d.getFullYear()].join('/')+' '+
    [d.getHours(),
    d.getMinutes()].join(':');
    var AddDateTime = dformat;
    $('.app-logo').html(AddDateTime);

    This will display the current date/time on the top menu next to the hamburger icon
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • this is 24hour format and this adds the 0 in minutes for 00-09

    var d = new Date,
    dformat = [d.getMonth()+1,
    d.getDate(),
    d.getFullYear()].join('/')+' '+
    [d.getHours(),
    (d.getMinutes()).html(AddDateTime);
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated