Sebastian Wulf7572695
Posts: 0
Joined: Fri Jun 05, 2015 2:02 pm

Display Date from Database in input (type date)

Hi,

i want to show a given Date in an input.
i set the type to date.
I have tried 2 different Solutions so far:

  1. set the text from the input to {{mydate}}
    The mydate is a String "2018-04-04T22:00:00.000Z"

  2. set the text from the input to {{getMyDate()}}
    GetMyDate() is a function:
    var dateAsString = "2015-11-14T00:00:00.000+0100";
    var dateAsObject = new Date(dateAsString);
    //return just date to display
    return dateAsObject.getDate();

    Thanks for your reply
    Sebastian

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Display Date from Database in input (type date)

Hello Sebastian,

It is much simpler to use the special AngularJS module to display dates, like this:
https://github.com/urish/angular-moment

Return to “Issues”