@advanced-rest-client/date-time

中文文档
3.0.3发布于 2021/10/20Apache-2.0CommonJS零依赖近 30 天下载 3259

An element to display formatted date and time

原始使用文档
文档目录8 节
  1. API components
  2. Usage
  3. Installation
  4. In an html file
  5. In a Polymer 3 element
  6. Installation
  7. Running the demo locally
  8. Running the tests

DEPRECATED

Use the @anypoint-web-components/awc module instead.


An element to render data and/or time formatted for user locale.

<date-time date="2010-12-10T11:50:45Z" year="numeric" month="narrow" day="numeric"></date-time>

API components

This components is a part of API components ecosystem

Usage

Installation

npm install --save @advanced-rest-client/date-time

In an html file

<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/date-time/date-time.js';
    </script>
  </head>
  <body>
    <date-time date="2010-12-10T11:50:45Z" year="numeric" month="long" day="numeric" hour="2-digit" minute="2-digit" second="2-digit"></date-time>
  </body>
</html>

In a Polymer 3 element

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/date-time/date-time.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <date-time date="2010-12-10T11:50:45Z" year="numeric" month="long" day="numeric" hour="2-digit" minute="2-digit" second="2-digit"></date-time>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Installation

git clone https://github.com/advanced-rest-client/date-time
cd date-time
npm install

Running the demo locally

npm start

Running the tests

npm test

版本与发布记录

@advanced-rest-client/date-time 共发布 5 个版本,首次发布于 2019/02/27;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.3latest2021/10/205 年前
3.0.22019/09/017 年前
3.0.12019/07/207 年前
3.0.02019/06/127 年前
3.0.0-preview.12019/02/277 年前

关于 @advanced-rest-client/date-time 的常见问题

@advanced-rest-client/date-time 是什么?

An element to display formatted date and time

如何安装 @advanced-rest-client/date-time?

在项目目录运行 npm install @advanced-rest-client/date-time,或使用 pnpm add / yarn add / bun add。

@advanced-rest-client/date-time 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/advanced-rest-client__date-time 是否存在。

@advanced-rest-client/date-time 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@advanced-rest-client/date-time 可以商用吗?

@advanced-rest-client/date-time 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@advanced-rest-client/date-time 的下载量有多少?

根据 npm 官方下载统计,@advanced-rest-client/date-time 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,259 次,日均约 109 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@advanced-rest-client/date-time 还在维护吗?

最新版本 3.0.3 发布于 2021/10/20(5 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/02/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。