Make time zone helper configurable
The following discussion from !48122 (merged) should be addressed:
-
@splattael started a discussion: Nice refactoring
❤ Non-blocking question
This helper is also used by the User Profile > Time settings and CI/CD > Pipelines which only need a subset of now exposed data. I wonder if we could make this helper configurable so each caller can pick and choose data they really need to reduce the amount of generated data (inline JSON) to be sent of the network.
Example:
module TimeZoneHelper TIME_ZONE_FORMATS = { all: %i[identifier name abbr offset formatted_offset], short: %i[name offset identifier] }.freeze # format: # * :all - all available fields # * :short (default) # * Array - custom field # # Example: # timezone_data # :short by default # timezone_data(format: :all) # timezone_data(format: %i[identifier name abbr formatted_offset]) # def timezone_data(format: :short) ... end end
I'll open a follow-up to continue the discussion.