In #1168126: Default value for every day of the week a new data structure is proposed:

$items = array(
  0 => array(
    0=> array(/* 1st day / 1st slot */),
    1=> array(/* 1st day / 2nd slot */),
  ),
  1 => array(
    0=> array(/* 2nd day / 1st slot */),
    1=> array(/* 2nd day / 2nd slot */),
  ),
  2 => array(
    0=> array(/* 3rd day / 1st slot */),
    1=> array(/* 3rd day / 2nd slot */),
  ),
  ...
);

If accepted, the formatter should be addapted (simplified!) to work with this data structure, and then some code at present in the widget could be moved to hook_field_load().

Comments

johnv’s picture

Status: Postponed » Active

#1168126: Default value for every day of the week is committed, so the formatter is free for simplification.
However, be aware that hook_field_load() and hook_field_presave() are not called for the default times in the Widget settings.

johnv’s picture

Status: Active » Closed (won't fix)