扫一扫分享
<1kb的简单日期和时间格式化程序
tinytime导出单个函数,该函数返回模板对象。该对象只有一个方法,render该方法采用a Date并返回包含渲染数据的字符串。
import tinytime from 'tinytime';
const template = tinytime('The time is {h}:{mm}:{ss}{a}.');
template.render(new Date());
// The time is 11:10:20PM.
仅供个人学习参考/导航指引使用,具体请以第三方网站说明为准,本站不提供任何专业建议。如果地址失效或描述有误,请联系站长反馈~感谢您的理解与支持!
手机预览