Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Import/Export] Format an instant in an IANA timezone

Đang mở Phù hợp với người mới
#830 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
web-dev

Hướng nghiên cứu

Bắt đầu từ src/lib/ics/dateTime.ts, tệp mà điều kiện tiên quyết #788 dự kiến sẽ tạo hoặc mở rộng, và đọc src/lib/domain/section.ts để lấy ví dụ khởi đầu. Thêm formatInstant(date, timeZone) sử dụng Intl.DateTimeFormat với timeZone được chỉ định rõ, sau đó kiểm tra src/lib/ics/dateTime.test.ts có bao phủ các ví dụ New_York và UTC cùng một múi giờ không hợp lệ. Hoàn thành khi pnpm test -- src/lib/ics/dateTime.test.ts, pnpm lint và pnpm typecheck đều thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

import-export

What to build

Format one exact moment using an explicitly chosen timezone. Calendar export must use that choice rather than the timezone or language settings of the contributor’s computer.

Files

  • src/lib/ics/dateTime.ts (extend the prerequisite’s file)
  • Starting example: src/lib/domain/section.ts
    Code to add or extend: formatInstant(date: Date, timeZone: string): string.

Steps

  1. Use Intl.DateTimeFormat with explicit timeZone, numeric date/time parts and hourCycle h23.
  2. Assemble formatToParts output using the existing formatter; append Z only when output timezone is UTC.
  3. Let an invalid IANA zone yield a clear error; do not rely on the computer locale.

Example

Date 2026-08-12T13:10:00Z/New_York → 20260812T091000; UTC → 20260812T131000Z.

Check it works

In src/lib/ics/dateTime.test.ts, check the example above and the failure or limit described in the steps. Run pnpm test -- src/lib/ics/dateTime.test.ts, pnpm lint and pnpm typecheck.

Before starting

  • #788 — Format local calendar date and time

References

Assign yourself before starting, or comment to claim the issue. Project setup.

Ngôn ngữ chính
TypeScript
Star
19
Fork
94
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DevDogsUGA/DogDays

Tất cả issue của DevDogsUGA/DogDays

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.