导言
模块包含将值格式化为窗体字段的 apis
- http://www.unicode.org/reports/tr35/tr35-dates.html#Date Field Symbol Table (中文(简体) )
- https://www.unicode.org/reports/tr35/tr35-numbers.html#数字 Patters
安装
保存为依赖
npm i --save @aemforms/af-formatters
使用量
import {format} from '@aemforms/af-formatters'
const value = 1234
format(1234, 'en-US', 'num|currency') //outputs $1,234.00
const value = 2022-10-10
format(1234, 'en-US', 'date|MMM dd, y') //outputs Oct 10, 2022
测试本地更改
# Build the package
npm run build
# Link it for local testing
npm link
在您使用此软件包的项目中 :
npm link @aemforms/af-formatters
许可证
版权2022 Adobe 所有权利保留.
本文所载的所有资料均为,现予保留 adobe及其供应商的财产,如果有的话。 知识分子 本文所载技术概念属于Adobe专有 并受到所有适用知识分子的保护 财产法,包括贸易秘密法和版权法. 传播这些资料或复制本材料 严格禁止,除非事先获得书面许可 从阿多比来.
Adobe 允许您仅根据 adobe许可协议的条款.