Page 1 of 1

Display Date from Database in input (type date)

Posted: Wed Apr 04, 2018 8:09 pm
by Sebastian Wulf7572695

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


Display Date from Database in input (type date)

Posted: Sat Apr 07, 2018 5:57 pm
by Serhii Kulibaba

Hello Sebastian,

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