timezone

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct{}

Service implements ports.TimeZoneService. Provides time zone conversion, meeting finder, and DST transition utilities.

func NewService

func NewService() *Service

NewService creates a new time zone service.

func (*Service) CheckDSTWarning

func (s *Service) CheckDSTWarning(ctx context.Context, t time.Time, zone string, warningDays int) (*domain.DSTWarning, error)

CheckDSTWarning checks if a time is near or during a DST transition. Returns a DSTWarning if the time is within warningDays of a transition.

func (*Service) ConvertTime

func (s *Service) ConvertTime(ctx context.Context, fromZone, toZone string, t time.Time) (time.Time, error)

ConvertTime converts a time from one zone to another.

func (*Service) FindMeetingTime

func (s *Service) FindMeetingTime(ctx context.Context, req *domain.MeetingFinderRequest) (*domain.MeetingTimeSlots, error)

FindMeetingTime finds overlapping working hours across multiple time zones. Analyzes each time zone's working hours and finds slots where all zones overlap.

func (*Service) GetDSTTransitions

func (s *Service) GetDSTTransitions(ctx context.Context, zone string, year int) ([]domain.DSTTransition, error)

GetDSTTransitions returns DST transition dates for a zone in a given year.

func (*Service) GetTimeZoneInfo

func (s *Service) GetTimeZoneInfo(ctx context.Context, zone string, at time.Time) (*domain.TimeZoneInfo, error)

GetTimeZoneInfo returns detailed information about a time zone at a specific time.

func (*Service) ListTimeZones

func (s *Service) ListTimeZones(ctx context.Context) ([]string, error)

ListTimeZones returns all available IANA time zones.

func (*Service) SuggestAlternativeTimes

func (s *Service) SuggestAlternativeTimes(ctx context.Context, t time.Time, zone string, duration time.Duration) ([]time.Time, error)

SuggestAlternativeTimes suggests alternative times when a time falls in a DST conflict. For spring forward gaps, suggests times before and after the gap. For fall back duplicates, suggests clarification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL