简体   繁体   English

nodejs package 用于在几个月内解析 excel 公式 DATEDIF?

[英]nodejs package for parsing excel formula DATEDIF in months?

looking for nodejs package that can read and process formula excel datedif in months在几个月内寻找可以读取和处理公式 excel datedif 的 nodejs package

im currently using handsontable/RuleJS https://handsontable.github.io/ruleJS/我目前正在使用handsontable/RuleJS https://handsontable.github.io/ruleJS/

but there is no datedif in month但是当月没有 datedif

i need a tool because the excel formula might be complex我需要一个工具,因为 excel 公式可能很复杂

from the current package i can do this in days从目前的 package 我可以在几天内做到这一点

'IF(DAYS("6/6/2019","1/1/2019") >= 30, 'IF(DAYS("6/6/2019","1/1/2019") >= 30,

now i need in months现在我需要几个月

if you have access to just the fields then moment may work ( npm i moment ):如果您只能访问这些字段,那么moment可能会起作用( npm i moment ):

var moment = require('moment');

// 'IF(DAYS("6/6/2019","1/1/2019") >= 30,
var result = moment('6/6/2019').add(1, 'months').isAfter(moment('1/1/2019'));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM