AngularJS get formatted date in ng-model

前端 未结 3 1776
星月不相逢
星月不相逢 2020-12-18 18:38

I have following text input filled by model value in timestamp:



        
3条回答
  •  無奈伤痛
    2020-12-18 19:20

    Try This code to Get a date Only (dd/mm/yyyy)

    html

    Angularjs

    app.controller('myctrl',function($scope, $http,$window,$filter) {
    $scope.sent=function(){
        $scope.date = $filter("date")($scope.dob, 'dd-MM-yyyy');
        alert($scope.date);
    }})
    

提交回复
热议问题