积分401 / 贡献0

提问29答案被采纳5文章46

作者动态

[经验分享] Luxon三方库发布啦 原创

润开鸿_坚果 显示全部楼层 发表于 2024-2-2 21:37:13

Luxon

Luxon is a library for working with dates and times in arkts.

本库由 白晓明,完成迁移。

一、下载安装

ohpm install @nutpi/luxon

OpenHarmony ohpm 环境配置等更多内容,请参考如何安装 OpenHarmony ohpm 包

二、使用

import { DateTime } from '@nutpi/luxon';

参数 options结构为:

import { DateTime } from '@nutpi/luxon';
@Entry
@Component
struct Index {
  @State message: string = '坚果派';

  build() {
    Row() {
      Column() {
        Text(DateTime.now().toString())
          .fontSize(20)
          .fontWeight(FontWeight.Bold)
      }
      .width('100%')
    }
    .height('100%')
  }
}

三、开源协议

本项目基于 Apache ,请自由地享受和参与开源。感谢moment

本库由 白晓明,完成迁移。

无用

©著作权归作者所有,转载或内容合作请联系作者

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

精彩评论2

马迪

沙发 发表于 2024-2-4 09:10:56
只有DateTime.now().toString()方法吗

润开鸿_坚果

发表于 2024-2-5 09:07  IP属地: 广东省广州市

回复 马迪: 其他的都有哇,一整套齐全的

【1 条回复】

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部