Fix civil-date public types: Day.date, currentPeriod, activeDate → YYYY-MM-DD strings

Aberta
#27 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Pouca atividade
Stack de tecnologia
typescript
Domínio
api

Direção de pesquisa

Start by reading the public types for Day and CalendarStore, then search for all-day event boundaries and existing tests that use Temporal.PlainDate. Update the affected exported types and usages so civil dates are YYYY-MM-DD strings while event start/end remain Date objects. Done means no exported type exposes Temporal.PlainDate, the named values and tests use identical ISO date strings, and consumers get a TypeScript error for the old property access.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement

Parent

https://github.com/TanStack/time/issues/25

What to build

Change every civil-date value at the public boundary from `Temporal.PlainDate` to a `YYYY-MM-DD` ISO string. This is a targeted breaking change that must land before the module API is built, so the correct types are foundational from the start.

Civil values affected: `Day.date`, `CalendarStore.currentPeriod`, `CalendarStore.activeDate`, and any all-day event boundary that is currently typed as `Temporal.PlainDate`.

Why: encoding a civil date as a `Temporal.PlainDate` leaks the Temporal polyfill into consumer types. Encoding it as a `Date` object introduces the all-day off-by-one bug (UTC-midnight reads incorrectly in west-of-UTC timezones). A `YYYY-MM-DD` string is the honest, zero-ambiguity representation of a calendar-civil day.

Instant-bearing values (event `start`/`end`) are unaffected — those remain `Date` objects.

Acceptance criteria

  • `Day.date` is typed as `string` and carries a `YYYY-MM-DD` value
  • `CalendarStore.currentPeriod` and `activeDate` are typed as `string` (`YYYY-MM-DD`)
  • No `Temporal.PlainDate` appears in any exported type
  • `Day.isoDate` (already present) is confirmed as the canonical fast-path key; `Day.date` and `Day.isoDate` carry identical values — one of them may be removed if redundant
  • All existing tests updated to reflect the new types
  • A consumer who previously accessed `Day.date.year` / `.month` / `.day` receives a TypeScript error pointing them to the ISO string instead

Blocked by

https://github.com/TanStack/time/issues/26

Linguagem predominante
TypeScript
Estrelas
620
Forks
6
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TanStack/time

Todas as issues de TanStack/time

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.