Moment.js Subtract: How to Subtract Time from a Moment
This is not a valid syntax in JavaScript. The correct syntax to subtract a moment from the current time using the Moment.js library is:
moment().subtract(duration, 'unit');
For example, to subtract 1 day from the current time:
moment().subtract(1, 'day');
Or to subtract 2 hours from the current time:
moment().subtract(2, 'hours');
原文地址: https://www.cveoy.top/t/topic/pdvr 著作权归作者所有。请勿转载和采集!