javascript - 如何使用 Moment JS 查找本月剩余的工作日数
问题描述
嘿伙计们,我正在尝试查找本月的工作日数。
使用moment-business-days
我可以计算出两个日期之间有多少个工作日。我也可以算出这周还有多少工作日。但是我很困惑如何找到本月还剩多少工作日。
const diffDays = moment(secondDate).businessDiff(
moment(firstDate),
"days",
true
); // this is where I find how many business days in between two dates
// and here how many business days left this week
const daysLeftThisWeek = 6 - moment(firstDate).day();
解决方案
推荐阅读
- pandas - SQLAlchemy的引用机制——SQL注入漏洞,找不到具体的代码引用
- java - 如何在 VSCode(独立)中将文本文件添加到 JUnit 5 类路径?
- swift - 解决使用 TupleView 的语法问题,其中 Content == TupleView<(Content1)> 或 Content == Content1
- vba - 我们如何在 Word 文档的起点和终点之间进行复制?
- html - 来自桌面客户端的 SAML 身份验证
- linux - 树莓派上的 VLC 视频流生成 stream_out_standard 错误
- haskell - Graphite 由于空接口导致错误
- arrays - Dataweave - 过滤数组并仅提取一个不为空的元素
- python - 在构造(初始化)之前无法迭代 AbstractOrderedScalarSet 'i':'__iter__' 是 Abstract 组件上的属性
- unicode - 隐藏空白符号(\n、\t 等)是否有特定名称?