Copyright © 2020 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
qs_key() = binary()
qs_prop() = {qs_key(), qs_value()}
qs_value() = binary() | #upload{} | term()
extract_languages/1 | Find all different language codes in the maps. |
from_list/1 | Convert a list for rsc insert and/or update to a map. |
from_props/1 | Transform a proplist from older resources and/or code to a (nested) map. |
from_qs/1 | Combine properties from a form. |
from_qs/2 | Like from_qs/1, except that a specific date is used to fill in any missing date/time parts. |
normalize_dates/3 | Normalize dates, ensure that all dates are in UTC and parsed to Erlang datetime format. |
prune_languages/2 | Check all trans records, remove languages not mentioned. |
extract_languages(Props::map()) -> [atom()]
Find all different language codes in the maps.
from_list(L::list()) -> {ok, #{binary() => term()}}
Convert a list for rsc insert and/or update to a map. The list could be a list of (binary) query args, or a property list with atom keys.
from_props(Ps::proplists:proplist() | undefined) -> map()
Transform a proplist from older resources and/or code to a (nested) map. This knows how to handle nestes lists like the 'blocks' list of lists.
from_qs(Qs::[qs_prop()]) -> {ok, #{binary() => term()}}
Combine properties from a form. The form consists of a flat list with query string properties. The result is a map which can be used by the rsc and other routines.
The keys can have a special format, specifying how they are processed:from_qs(Qs::[qs_prop()], Now::calendar:datetime()) -> {ok, #{binary() => term()}}
Like from_qs/1, except that a specific date is used to fill in any missing date/time parts.
normalize_dates(Props::m_rsc:props(), IsAllDay::boolean(), Tz::binary() | undefined) -> m_rsc:props()
Normalize dates, ensure that all dates are in UTC and parsed to Erlang datetime format.
prune_languages(Props::map(), Langs::[atom()]) -> map()
Check all trans records, remove languages not mentioned.
Generated by EDoc