Documentation
¶
Index ¶
- type Service
- func (s *Service) CheckDSTWarning(ctx context.Context, t time.Time, zone string, warningDays int) (*domain.DSTWarning, error)
- func (s *Service) ConvertTime(ctx context.Context, fromZone, toZone string, t time.Time) (time.Time, error)
- func (s *Service) FindMeetingTime(ctx context.Context, req *domain.MeetingFinderRequest) (*domain.MeetingTimeSlots, error)
- func (s *Service) GetDSTTransitions(ctx context.Context, zone string, year int) ([]domain.DSTTransition, error)
- func (s *Service) GetTimeZoneInfo(ctx context.Context, zone string, at time.Time) (*domain.TimeZoneInfo, error)
- func (s *Service) ListTimeZones(ctx context.Context) ([]string, error)
- func (s *Service) SuggestAlternativeTimes(ctx context.Context, t time.Time, zone string, duration time.Duration) ([]time.Time, error)
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 (*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 ¶
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.