vista_client v0.1.1 VistaClient.Transformations.Filters.FilmsSessions

Link to this section Summary

Functions

Takes a list of film_sessions and returns same list with all sessions that have started already (specified as cutoff_date_time) filtered out.

Compares session's showtime with cutoff_datetime. Returns true if showtime is after cutoff_datetime.

Link to this section Functions

Link to this function

filter_films_sessions(arg, cutoff_datetime)

Link to this function

filter_started(film_sessions, cutoff_datetime)

Takes a list of film_sessions and returns same list with all sessions that have started already (specified as cutoff_date_time) filtered out.

Link to this function

filter_started_30mins(film_sessions)

Link to this function

session_expired?(session, cutoff_datetime)

Compares session's showtime with cutoff_datetime. Returns true if showtime is after cutoff_datetime.

Examples

iex> session = %Session{showtime: "2019-03-21 12:20:00.00000Z" |> NaiveDateTime.fromiso8601} iex> cutoffdatetime = "2019-03-21 12:20:00.00000Z" |> DateTime.from_iso8601() |> elem(1) iex> __MODULE.session_expired?(session, cutoff_datetime) false

iex> session = %Session{showtime: "2019-03-21 12:20:00.00000Z" |> NaiveDateTime.fromiso8601} iex> cutoffdatetime = "2019-03-21 12:10:00.00000Z" |> DateTime.from_iso8601() |> elem(1) iex> __MODULE.session_expired?(session, cutoff_datetime) false

Link to this function

session_valid?(session, cutoff_datetime)