View Source Plausible.Site (Plausible v0.0.1)
Site schema
Summary
Functions
Returns the date of the first recorded stat in the timezone configured by the user. This function does 2 transformations: UTC %NaiveDateTime{} -> Local %DateTime{} -> Local %Date
Types
@type t() :: %Plausible.Site{ __meta__: term(), allowed_event_props: term(), conversions_enabled: term(), custom_domain: term(), domain: term(), domain_changed_at: term(), domain_changed_from: term(), from_cache?: term(), funnels_enabled: term(), goals: term(), google_auth: term(), id: term(), imported_data: term(), ingest_rate_limit_scale_seconds: term(), ingest_rate_limit_threshold: term(), inserted_at: term(), invitations: term(), list_type: term(), locked: term(), members: term(), memberships: term(), monthly_report: term(), native_stats_start_at: term(), owner: term(), ownership: term(), props_enabled: term(), public: term(), revenue_goals: term(), spike_notification: term(), stats_start_date: term(), timezone: term(), updated_at: term(), weekly_report: term() }
Functions
Returns the date of the first recorded stat in the timezone configured by the user. This function does 2 transformations: UTC %NaiveDateTime{} -> Local %DateTime{} -> Local %Date
Examples
iex> Plausible.Site.local_start_date(%Plausible.Site{stats_start_date: nil}) nil
iex> utc_start = ~N[2022-09-28 00:00:00] iex> tz = "Europe/Helsinki" iex> site = %Plausible.Site{stats_start_date: utc_start, timezone: tz} iex> Plausible.Site.local_start_date(site) ~D[2022-09-28]
iex> utc_start = ~N[2022-09-28 00:00:00] iex> tz = "America/Los_Angeles" iex> site = %Plausible.Site{stats_start_date: utc_start, timezone: tz} iex> Plausible.Site.local_start_date(site) ~D[2022-09-27]