P0 MVP: - 认证:login/refresh/logout/forgot/reset + tokenVersion - RBAC:角色到权限映射 + requirePermission - 发票池:upload/bind/signed-url + 判重(VALID_003/VALID_005) - 报销:create/view/submit + 单号生成 - 工作流:approve + department_manager 解析 P1 扩展: - 动作:reject/return/withdraw(含 comment) - transfer:任务转审 + 链路上限 3 - pay:approved -> paid + 发票归档 used_complete - 动态审批链:approval_rules 驱动 回归脚本: - smoke-test.sh / regression-dedup.sh / regression-workflow-actions.sh
25 行
493 B
JavaScript
25 行
493 B
JavaScript
function currentDateString(timeZone) {
|
|
const formatter = new Intl.DateTimeFormat("en-CA", {
|
|
timeZone,
|
|
year: "numeric",
|
|
month: "2-digit",
|
|
day: "2-digit",
|
|
});
|
|
|
|
return formatter.format(new Date());
|
|
}
|
|
|
|
function compactDateString(timeZone) {
|
|
return currentDateString(timeZone).replaceAll("-", "");
|
|
}
|
|
|
|
function parseDateOnlyString(value) {
|
|
return new Date(`${value}T00:00:00.000Z`);
|
|
}
|
|
|
|
module.exports = {
|
|
compactDateString,
|
|
currentDateString,
|
|
parseDateOnlyString,
|
|
};
|