Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed moment timezone configuration. (#5916)
When we use moment.tz.zone( settings.timezone.string ) moment returns us an object which contains the offsets property with a large array, but also returns arrays of the same sizes for untils and abbrs. When timezone was passed back to the moment (to configure it) we only passed the offsets array and we used an array with a null value for untils and an array with 'WP' for the abbrs. This made moment logic not work correctly. If besides offsets we also passback untils and abbrs arrays things work as expected. Given that our logic worked correctly when the timezone contains just the offset (a UTC value was set as timezone instead of a city), there is no need to maintain two logics because if we select a city as timezone we have access to offset anyway which was computed on the server using get_option( 'gmt_offset', 0 ); So we are changing the moment timezone configuration to rely just on the offset.
- Loading branch information