Refactor to pass a formatting function for <live-date-time>