# @bbc/moment-timezone-include 中文文档

规范地址：https://npmcn.com/package/%40bbc/moment-timezone-include/

版本：1\.1\.8
npm 元数据更新时间：2026-04-16T10:45:03.171Z
中文译文更新时间：2026-11-07T18:59:55.585Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bbc/moment-timezone-include
原文对照：https://npmcn.com/package/%40bbc/moment-timezone-include/?lang=original
项目主页：https://github.com/bbc/psammead/blob/latest/packages/utilities/moment-timezone-include/README.md
源码仓库：https://github.com/bbc/psammead/tree/latest/packages/utilities/moment-timezone-include

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：24 kB，23 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：4 个
- peer 依赖：webpack ^4\.38\.0
- 首次发布：2019-08-01T08:24:57.199Z
- 最新版本发布：2021-03-10T12:59:03.471Z
- 近 30 天下载量：3920（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：10（近 12 个月 0 个）

## 中文简介

Webpack插件和时区数据包括将特定时区数据拉入所期望的块.

## 安装

```sh
npm install @bbc/moment-timezone-include
```

也可以使用：`pnpm add @bbc/moment-timezone-include`、`yarn add @bbc/moment-timezone-include`、`bun add @bbc/moment-timezone-include`

## README

# @bbc/moment-timezone 包含 - [![Known Vulnerabilities](https://snyk.io/test/github/bbc/psammead/badge.svg?targetFile=packages%2Futilities%2Fmoment-timezone-include%2Fpackage.json)](https://snyk.io/test/github/bbc/psammead?targetFile=packages%2Futilities%2Fmoment-timezone-include%2Fpackage.json) [![Dependency Status](https://david-dm.org/bbc/psammead.svg?path=packages/utilities/moment-timezone-include)](https://david-dm.org/bbc/psammead?path=packages/utilities/moment-timezone-include) [![peerDependencies Status](https://david-dm.org/bbc/psammead/peer-status.svg?path=packages/utilities/moment-timezone-include)](https://david-dm.org/bbc/psammead?path=packages/utilities/moment-timezone-include&type=peer) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/bbc/psammead/blob/latest/LICENSE) [![npm version](https://img.shields.io/npm/v/@bbc/moment-timezone-include.svg)](https://www.npmjs.com/package/@bbc/moment-timezone-include) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md)

此软件包允许您排除所有瞬间时区被包含, 同时将特定时区包含在您想要的块中 .

## 安装

```jsx
npm install @bbc/moment-timezone-include --save
```

## 用法 - 不包括默认时区

```jsx
plugins: [new MomentTimezoneInclude({ startYear: 1990, endYear: 2025 })],
```

这有两件事 首先,它从瞬间区包中删除所有时区,以便它们能够被单独纳入。 它还规定了具体包含的时区数据的日期范围. 若为 `startYear` 不提供默认的最早可用数据,如果 `endYear` 不包括所有已知的未来数据.

## 用法 - 包含特定的时区

```jsx
import '@bbc/moment-timezone-include/tz/America/New_York'
```

这使得指定的时区可以瞬间使用. 它通过替换支持所有瞬间时区 `America/New_York` 以任意时区为例。 完整的时区列表可见 [这里](https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json)。 。 。 .

## 捐款

Psammead完全开源. 我们感谢任何贡献,无论是新的组件、错误修正还是总体改进。 请参看我们的主要贡献指南,可查阅: [psammead 仓库的根](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md)。 。 。 .

### [行为守则](https://github.com/bbc/psammead/blob/latest/CODE_OF_CONDUCT.md)

我们欢迎对这项工作的反馈和帮助。 通过参与这个项目,你同意遵守 [行为守则](https://github.com/bbc/psammead/blob/latest/CODE_OF_CONDUCT.md)请稍候再读一下.

### 许可证

萨姆米德 [Apache 2.0 许可](https://github.com/bbc/psammead/blob/latest/LICENSE)。 。 。 .

## 常见问题

### @bbc/moment-timezone-include 是什么？

Webpack插件和时区数据包括将特定时区数据拉入所期望的块\.

### 如何安装 @bbc/moment-timezone-include？

在项目目录运行 npm install @bbc/moment-timezone-include，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：webpack（^4\.38\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bbc/moment-timezone-include 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/bbc\_\_moment-timezone-include 是否存在。

### @bbc/moment-timezone-include 支持 ESM 还是 CommonJS？

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

### @bbc/moment-timezone-include 可以商用吗？

@bbc/moment-timezone-include 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @bbc/moment-timezone-include 的下载量有多少？

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

### @bbc/moment-timezone-include 还在维护吗？

最新版本 1\.1\.8 发布于 2021/03/10（5 年前）；至今共发布 10 个版本，其中过去 12 个月发布了 0 个；首次发布于 2019/08/01。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

