elogger API
Overview Classes Cluster Class Index          Top Features

time.date

Class DT_WEEK_DAYS_FROM_SUNDAY


Direct ancestors

DT_GREGORIAN_CALENDAR

Known direct descendants

DT_WEEK_DAY_FROM_SUNDAY

Features

Invariants

indexing

description

Shared days of the week which start on Sunday

library

Gobo Eiffel Time Library

copyright

Copyright (c) 2004, Colin Adams and others

license

Eiffel Forum License v2 (see forum.txt)

class DT_WEEK_DAYS_FROM_SUNDAY

inherit

DT_GREGORIAN_CALENDAR
KL_GREGORIAN_CALENDAR

feature -- Access

week_number (y, m, d: INTEGER): INTEGER

-- Week number for date of year y, month m and day d,
-- using ISO 8601 specification: weeks start on Monday and
-- week number 1 contains the first Thursday of the year.
-- Dates before the first week of the year have the week
-- number of of last day of the previous year.
-- (From DT_GREGORIAN_CALENDAR)

require

m_large_enough: m >= January
m_small_enough: m <= December
d_large_enough: d >= 1
d_small_enough: d <= days_in_month (m, y)

ensure

week_number_large_enough: Result >= 1
week_number_small_enough: Result <= 53

friday: DT_WEEK_DAY_FROM_SUNDAY

-- Friday

ensure

friday_not_void: Result /= Void
is_friday: Result.is_friday

monday: DT_WEEK_DAY_FROM_SUNDAY

-- Monday

ensure

monday_not_void: Result /= Void
is_monday: Result.is_monday

saturday: DT_WEEK_DAY_FROM_SUNDAY

-- Saturday

ensure

saturday_not_void: Result /= Void
is_saturday: Result.is_saturday

sunday: DT_WEEK_DAY_FROM_SUNDAY

-- Sunday

ensure

sunday_not_void: Result /= Void
is_sunday: Result.is_sunday

thursday: DT_WEEK_DAY_FROM_SUNDAY

-- Thursday

ensure

thursday_not_void: Result /= Void
is_thursday: Result.is_thursday

tuesday: DT_WEEK_DAY_FROM_SUNDAY

-- Tuesday

ensure

tuesday_not_void: Result /= Void
is_tuesday: Result.is_tuesday

wednesday: DT_WEEK_DAY_FROM_SUNDAY

-- Wednesday

ensure

wednesday_not_void: Result /= Void
is_wednesday: Result.is_wednesday

week_day_from_code (a_code: INTEGER): DT_WEEK_DAY_FROM_SUNDAY

-- Week day with code a_code

require

a_code_valid: a_code >= 1 and a_code <= Days_in_week

ensure

monday: a_code = monday_code implies Result = monday
tuesday: a_code = tuesday_code implies Result = tuesday
wednesday: a_code = wednesday_code implies Result = wednesday
thursday: a_code = thursday_code implies Result = thursday
friday: a_code = friday_code implies Result = friday
saturday: a_code = saturday_code implies Result = saturday
sunday: a_code = sunday_code implies Result = sunday

week_day_from_date (a_date: DT_DATE): DT_WEEK_DAY_FROM_SUNDAY

-- Week day for a_date

require

a_date_not_void: a_date /= Void

ensure

week_day_not_void: Result /= Void

week_day_from_year_month_day (a_year, a_month, a_day: INTEGER): DT_WEEK_DAY_FROM_SUNDAY

-- Week day for a_day in a_month of a_year

require

month_large_enough: a_month >= January
month_small_enough: a_month <= December
day_large_enough: a_day >= 1
day_small_enough: a_day <= days_in_month (a_month, a_year)

ensure

week_day_not_void: Result /= Void

feature -- Status report

valid_week (a_week, a_year: INTEGER): BOOLEAN

-- Is a_week a valid ISO 8601 week in a_year?
-- Weeks start on Monday and week number 1 contains
-- the first Thursday of the year.
-- (From DT_GREGORIAN_CALENDAR)

feature -- Codes

friday_code: INTEGER

-- Code for Friday

monday_code: INTEGER

-- Code for Monday

saturday_code: INTEGER

-- Code for Saturday

sunday_code: INTEGER

-- Code for Sunday

thursday_code: INTEGER

-- Code for Thursday

tuesday_code: INTEGER

-- Code for Tuesday

wednesday_code: INTEGER

-- Code for Wednesday

feature -- Epoch

Epoch_day: INTEGER

-- Epoch date (1 Jan 1970)
-- (From KL_GREGORIAN_CALENDAR)

epoch_days (y, m, d: INTEGER): INTEGER

-- Number of days since epoch date (1 Jan 1970)
-- (From KL_GREGORIAN_CALENDAR)

require

m_large_enough: m >= January
m_small_enough: m <= December
d_large_enough: d >= 1
d_small_enough: d <= days_in_month (m, y)

Epoch_month: INTEGER

Epoch_year: INTEGER

feature -- Month

April: INTEGER

August: INTEGER

days_at_month (m, y: INTEGER): INTEGER

-- Number of days from beginning of year
-- y until beginning of month m
-- (From KL_GREGORIAN_CALENDAR)

require

m_large_enough: m >= January
m_small_enough: m <= December

ensure

days_positive: Result >= 0

days_in_month (m, y: INTEGER): INTEGER

-- Number of days in month m of year y
-- (From KL_GREGORIAN_CALENDAR)

require

m_large_enough: m >= January
m_small_enough: m <= December

ensure

at_least_one: Result >= 1
max_days_in_month: Result <= Max_days_in_month

December: INTEGER

-- Months
-- (From KL_GREGORIAN_CALENDAR)

February: INTEGER

January: INTEGER

July: INTEGER

June: INTEGER

March: INTEGER

Max_days_in_month: INTEGER

-- Maximum number of days in a month
-- (From KL_GREGORIAN_CALENDAR)

May: INTEGER

November: INTEGER

October: INTEGER

September: INTEGER

feature -- Time

Hours_in_day: INTEGER

-- Number of hours in a day
-- (From KL_GREGORIAN_CALENDAR)

Milliseconds_in_day: INTEGER

-- Number of milliseconds in a day
-- (From KL_GREGORIAN_CALENDAR)

Minutes_in_hour: INTEGER

-- Number of minutes in an hour
-- (From KL_GREGORIAN_CALENDAR)

Seconds_in_day: INTEGER

-- Number of seconds in a day
-- (From KL_GREGORIAN_CALENDAR)

Seconds_in_hour: INTEGER

-- Number of seconds in an hour
-- (From KL_GREGORIAN_CALENDAR)

Seconds_in_minute: INTEGER

-- Number of seconds in a minute
-- (From KL_GREGORIAN_CALENDAR)

feature -- Week day

Days_in_week: INTEGER

-- Number of days in a week
-- (From KL_GREGORIAN_CALENDAR)

obsolete_friday: INTEGER

obsolete_monday: INTEGER

obsolete_next_day (d: INTEGER): INTEGER

-- Week day after d
-- (From KL_GREGORIAN_CALENDAR)

obsolete

[041224] Use next_day from DT_WEEK_DAY instead.

require

d_large_enough: d >= Sunday
d_small_enough: d <= Saturday

ensure

sunday_definition: (d = Sunday) implies (Result = Monday)
monday_definition: (d = Monday) implies (Result = Tuesday)
tuesday_definition: (d = Tuesday) implies (Result = Wednesday)
wednesday_definition: (d = Wednesday) implies (Result = Thursday)
thursday_definition: (d = Thursday) implies (Result = Friday)
friday_definition: (d = Friday) implies (Result = Saturday)
saturday_definition: (d = Saturday) implies (Result = Sunday)

obsolete_previous_day (d: INTEGER): INTEGER

-- Week day before d
-- (From KL_GREGORIAN_CALENDAR)

obsolete

[041224] Use previous_day from DT_WEEK_DAY instead.

require

d_large_enough: d >= Sunday
d_small_enough: d <= Saturday

ensure

sunday_definition: (d = Sunday) implies (Result = Saturday)
monday_definition: (d = Monday) implies (Result = Sunday)
tuesday_definition: (d = Tuesday) implies (Result = Monday)
wednesday_definition: (d = Wednesday) implies (Result = Tuesday)
thursday_definition: (d = Thursday) implies (Result = Wednesday)
friday_definition: (d = Friday) implies (Result = Thursday)
saturday_definition: (d = Saturday) implies (Result = Friday)

obsolete_saturday: INTEGER

-- Week days
-- obsolete
-- "[041224] Use DT_WEEK_DAY instead."
-- (From KL_GREGORIAN_CALENDAR)

obsolete_sunday: INTEGER

obsolete_thursday: INTEGER

obsolete_tuesday: INTEGER

obsolete_wednesday: INTEGER

feature -- Year

Days_in_100_years: INTEGER

Days_in_2_leap_years: INTEGER

-- Number of days in multiple years
-- (From KL_GREGORIAN_CALENDAR)

Days_in_2_years: INTEGER

Days_in_3_leap_years: INTEGER

Days_in_3_years: INTEGER

Days_in_400_years: INTEGER

Days_in_4_years: INTEGER

Days_in_leap_year: INTEGER

-- Number of days in a (leap) year
-- (From KL_GREGORIAN_CALENDAR)

Days_in_year: INTEGER

leap_year (y: INTEGER): BOOLEAN

-- Is y a leap year?
-- (From KL_GREGORIAN_CALENDAR)

Months_in_year: INTEGER

-- Number of months in a year
-- ensure
-- definition: Result = (December - Januray + 1)
-- (From KL_GREGORIAN_CALENDAR)

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc