gpt4 book ai didi

javascript - 时刻js中的大写第一个字母

转载 作者:行者123 更新时间:2023-12-03 07:09:55 25 4
gpt4 key购买 nike

有没有办法使用moment js将第一个字母变成大写?

Current output:

moment([20016, 0, 29]).fromNow(); // 4 years ago


Expected output:

moment([2016, 0, 29]).fromNow(); // 4 Years Ago

最佳答案

  .capitalize {
text-transform: capitalize;
}
应用以下类(class)将为您提供所需的效果。
编辑:
如果 CSS 不是你的菜,有几个不同的例子来说明如何使用 JS here .

关于javascript - 时刻js中的大写第一个字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64790603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com