# `Calendrical.Julian`

# `day`

```elixir
@type day() :: 1..31
```

# `month`

```elixir
@type month() :: 1..12
```

# `year`

```elixir
@type year() :: -9999..-1 | 1..9999
```

# `calendar_base`

Identifies that this calendar is month based.

# `calendar_year`

```elixir
@spec calendar_year(year(), month(), day()) :: Calendar.year()
```

Returns the calendar year as displayed
on rendered calendars.

# `cldr_calendar_type`

Defines the CLDR calendar type for this calendar.

This type is used in support of `Calendrical.localize/3`.
Currently only `:gregorian` is supported.

# `cyclic_year`

```elixir
@spec cyclic_year(year(), month(), day()) :: Calendar.year()
```

Returns the cyclic year as displayed
on rendered calendars.

# `date_from_iso_days`

Returns a `{year, month, day}` calculated from
the number of `iso_days`.

# `date_to_iso_days`

Returns the number of days since the calendar
epoch for a given `year-month-day`

# `datetime_to_string`

# `day_of_era`

```elixir
@spec day_of_era(year(), month(), day()) :: {day :: pos_integer(), era :: 0..1}
```

Calculates the day and era from the given `year`, `month`, and `day`.

# `day_of_week`

```elixir
@spec day_of_week(year(), month(), day(), 1..7 | :default) ::
  {Calendar.day_of_week(), first_day_of_week :: non_neg_integer(),
   last_day_of_week :: non_neg_integer()}
```

Calculates the day of the week from the given `year`, `month`, and `day`.
It is an integer from 1 to 7, where 1 is Monday and 7 is Sunday.

# `day_of_year`

```elixir
@spec day_of_year(year(), month(), day()) :: 1..366
```

Calculates the day of the year from the given `year`, `month`, and `day`.

# `days_in_month`

```elixir
@spec days_in_month(month()) :: Calendar.day() | {:error, :unresolved}
```

Returns how many days there are in the given month.

If the days in month cannot be determined without
knowning the year an error tuple is returned.

# `days_in_month`

```elixir
@spec days_in_month(year(), month()) :: 28..31
```

Returns how many days there are in the given year-month.

# `days_in_week`

Returns the number days in a a week.

# `days_in_year`

Returns the number days in a given year.

# `epoch`

# `extended_year`

```elixir
@spec extended_year(year(), month(), day()) :: Calendar.year()
```

Returns the extended year as displayed
on rendered calendars.

# `iso_week_of_year`

```elixir
@spec iso_week_of_year(year(), month(), day()) :: {:error, :not_defined}
```

Calculates the ISO week of the year from the given `year`, `month`, and `day`.
It is an integer from 1 to 53.

# `leap_year?`

```elixir
@spec leap_year?(year :: Calendar.year()) :: boolean()
```

Returns if the given year is a leap year.

# `month`

Returns a `t:Date.Range.t/0` representing
a given month of a year.

# `month_of_year`

```elixir
@spec month_of_year(year(), month(), day()) :: month()
```

Calculates the month of the year from the given `year`, `month`, and `day`.
It is an integer from 1 to 12.

# `naive_datetime_from_iso_days`

```elixir
@spec naive_datetime_from_iso_days(Calendar.iso_days()) ::
  {Calendar.year(), Calendar.month(), Calendar.day(), Calendar.hour(),
   Calendar.minute(), Calendar.second(), Calendar.microsecond()}
```

Converts the `t:Calendar.iso_days/0` format to the datetime format specified by this calendar.

# `naive_datetime_to_iso_days`

```elixir
@spec naive_datetime_to_iso_days(
  Calendar.year(),
  Calendar.month(),
  Calendar.day(),
  Calendar.hour(),
  Calendar.minute(),
  Calendar.second(),
  Calendar.microsecond()
) :: Calendar.iso_days()
```

Returns the `t:Calendar.iso_days/0` format of the specified date.

# `periods_in_year`

Calculates the number of period in a given `year`. A period
corresponds to a month in month-based calendars and
a week in week-based calendars..

# `plus`

Adds an `increment` number of `date_part`s
to a `year-month-day`.

`date_part` can be `:years`, `:quarters`
 or`:months`.

# `quarter`

Returns a `t:Date.Range.t/0` representing
a given quarter of a year.

# `quarter_of_year`

```elixir
@spec quarter_of_year(year(), month(), day()) :: 1..4
```

Calculates the quarter of the year from the given `year`, `month`, and `day`.
It is an integer from 1 to 4.

# `related_gregorian_year`

```elixir
@spec related_gregorian_year(year(), month(), day()) :: Calendar.year()
```

Returns the related gregorian year as displayed
on rendered calendars.

# `shift_date`

```elixir
@spec shift_date(Calendar.year(), Calendar.month(), Calendar.day(), Duration.t()) ::
  {Calendar.year(), Calendar.month(), Calendar.day()}
```

Shifts a date by given duration.

# `shift_naive_datetime`

```elixir
@spec shift_naive_datetime(
  Calendar.year(),
  Calendar.month(),
  Calendar.day(),
  Calendar.hour(),
  Calendar.minute(),
  Calendar.second(),
  Calendar.microsecond(),
  Duration.t()
) ::
  {Calendar.year(), Calendar.month(), Calendar.day(), Calendar.hour(),
   Calendar.minute(), Calendar.second(), Calendar.microsecond()}
```

Shifts a naive date time by given duration.

# `shift_time`

```elixir
@spec shift_time(
  Calendar.hour(),
  Calendar.minute(),
  Calendar.second(),
  Calendar.microsecond(),
  Duration.t()
) ::
  {Calendar.hour(), Calendar.minute(), Calendar.second(),
   Calendar.microsecond()}
```

Shifts a time by given duration.

# `valid_date?`

Determines if the date given is valid according to this calendar.

# `week`

Returns a `t:Date.Range.t/0` representing
a given week of a year.

# `week_of_month`

```elixir
@spec week_of_month(year(), month(), day()) ::
  {pos_integer(), pos_integer()} | {:error, :not_defined}
```

Calculates the week of the year from the given `year`, `month`, and `day`.
It is an integer from 1 to 53.

# `week_of_year`

```elixir
@spec week_of_year(year(), month(), day()) :: {:error, :not_defined}
```

Calculates the week of the year from the given `year`, `month`, and `day`.
It is an integer from 1 to 53.

# `year`

Returns a `t:Date.Range.t/0` representing
a given year.

# `year_of_era`

```elixir
@spec year_of_era(year()) :: {year(), era :: 0..1}
```

Calculates the year and era from the given `year`.
The ISO calendar has two eras: the current era which
starts in year 1 and is defined as era "1". And a
second era for those years less than 1 defined as
era "0".

# `year_of_era`

```elixir
@spec year_of_era(year(), month(), day()) :: {year :: Calendar.year(), era :: 0..1}
```

Calculates the year and era from the given `year`,
`month` and `day`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
