# `JSCalendar.Task`
[🔗](https://github.com/elixir-tempo/jscalendar/blob/v0.1.0/lib/jscalendar/event.ex#L115)

Something to be done, optionally by a certain time
([RFC 8984 §5.2](https://www.rfc-editor.org/rfc/rfc8984.html#section-5.2)).

A task differs from an event in what it may leave out. Both `start`
and `due` are optional, because "someday" is a real state for a task
and not for a meeting, and `estimated_duration` is how long the work
takes rather than how long it occupies the calendar.

# `t`

```elixir
@type t() :: %JSCalendar.Task{
  alerts: term(),
  categories: term(),
  color: term(),
  created: term(),
  description: term(),
  description_content_type: term(),
  due: NaiveDateTime.t() | nil,
  estimated_duration: Duration.t() | nil,
  excluded: term(),
  excluded_recurrence_rules: term(),
  extra: map(),
  free_busy_status: term(),
  keywords: term(),
  links: term(),
  locale: term(),
  localizations: term(),
  locations: term(),
  method: term(),
  participants: term(),
  percent_complete: non_neg_integer() | nil,
  priority: term(),
  privacy: term(),
  prod_id: term(),
  progress: String.t() | nil,
  progress_updated: term(),
  recurrence_id: term(),
  recurrence_id_time_zone: term(),
  recurrence_overrides: term(),
  recurrence_rules: term(),
  related_to: term(),
  reply_to: term(),
  request_status: term(),
  sent_by: term(),
  sequence: term(),
  show_without_time: term(),
  start: NaiveDateTime.t() | nil,
  status: String.t() | nil,
  time_zone: term(),
  time_zones: term(),
  title: String.t(),
  uid: String.t() | nil,
  updated: term(),
  use_default_alerts: term(),
  virtual_locations: term()
}
```

A calendar task.

# `from_map`

```elixir
@spec from_map(map()) :: {:ok, struct()} | {:error, term()}
```

Read this object from a decoded JSON map.

### Arguments

* `map` is a map with string keys, as `:json.decode/1` returns.

### Returns

* `{:ok, object}`; or

* `{:error, reason}` when a property does not match its declared
  type.

# `jscalendar_type`

```elixir
@spec jscalendar_type() :: String.t()
```

The `@type` value RFC 8984 gives this object.

### Returns

* the type name as a string.

# `to_map`

```elixir
@spec to_map(struct()) :: map()
```

Write this object back to a JSON-ready map.

### Arguments

* `object` is a `t:t/0`.

### Returns

* a map with string keys, ready for `:json.encode/1`.

---

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