Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: time core #12

Open
wants to merge 7 commits into
base: v0
Choose a base branch
from

Conversation

bart-krakowski
Copy link

@bart-krakowski bart-krakowski commented Jun 25, 2024

TimeCore

Summary

This PR proposes the creation of a TimeCore abstract class to serve as the foundational core for managing time-related functionalities. This class can be extended to create specific components such as timers, stopwatches, alarm clocks, and clocks. The TimeCore class leverages the Temporal API for precise time management and supports updating the current time at regular intervals.

Motivation

The motivation behind this RFC is to provide a flexible and efficient core for time-related components, enabling consistent and simplified management of time functionalities. By creating an abstract TimeCore class, we ensure a robust foundation that can be extended to various use cases, such as timers, stopwatches, and clocks, while maintaining consistent behavior and time management practices.

Parameters

  • timeZone?: Temporal.TimeZoneLike
    An optional parameter that specifies the time zone to use for the current time. Defaults to the system's time zone.

###Methods

  • getCurrentTime(): Temporal.ZonedDateTime
    Returns the current time.
  • setTimeZone(timeZone: Temporal.TimeZoneLike): void
    Sets a new time zone and updates the current time accordingly.
  • startUpdatingTime(intervalMs?: number): void
    Starts updating the current time at the specified interval in milliseconds.
  • stopUpdatingTime(): void
    Stops updating the current time.

@bart-krakowski bart-krakowski changed the title Feat/time core feat: time core Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant