Calculating days difference with using angular and jQuery datepicker

后端 未结 2 944
天命终不由人
天命终不由人 2020-12-17 04:42

In angular, I am trying to calculate the number of days between two selected date with using jQuery datepicker. It returns only null with the function that I am using..

2条回答
  •  生来不讨喜
    2020-12-17 05:21

    angular-moment does the trick! ...and (very) else more.

    Using the amDifference filter:

    Get the difference between two dates in milliseconds. Parameters are date, units and usePrecision. Date defaults to current date. Example:

    Difference: {{ dateFrom | amDifference : dateTo : 'days' }} days
    

提交回复
热议问题