node.js - How to subtract two dates in moment-jalaali on NodeJS -


the question how subtract 2 jalaali dates in moment-jalaali package on nodejs?. cannot find subtract 2 dates on their api in js.

only related function subtract works jmonth, day or jyear.

apparently there not function now. trick can using subtract likes following:

 // m1: first day 1392/5/10 - m2 : second day 1387/3/2  let m3 = m1.subtract(m2.jyear(), 'jyear');  m3 = m3.subtract(m2.jmonth(), 'jmonth');  m3 = m3.subtract(m2.jdate(), 'day'); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -