diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-10 03:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-10 03:08:43 +0300 |
commit | 070ac34d473978dc27ea2878ed1cf17865e24e9a (patch) | |
tree | 2abb88435614f49c3ce3baed2f3316e6140d95a4 /app/assets/javascripts/lib | |
parent | d4b2ad25a56a9baf41a27a2190458330645b3102 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/datetime/date_format_utility.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js index 737c18d1bce..04a82836f69 100644 --- a/app/assets/javascripts/lib/utils/datetime/date_format_utility.js +++ b/app/assets/javascripts/lib/utils/datetime/date_format_utility.js @@ -414,21 +414,21 @@ export const durationTimeFormatted = (duration) => { * * @param {Number} offset UTC offset in seconds as a integer * - * @return {String} the + or - offset in hours, e.g. `- 10`, `0`, `+ 4` + * @return {String} the + or - offset in hours, e.g. `-10`, ` 0`, `+4` */ export const formatUtcOffset = (offset) => { const parsed = parseInt(offset, 10); if (Number.isNaN(parsed) || parsed === 0) { - return `0`; + return ` 0`; } const prefix = offset > 0 ? '+' : '-'; - return `${prefix} ${Math.abs(offset / 3600)}`; + return `${prefix}${Math.abs(offset / 3600)}`; }; /** * Returns formatted timezone * * @param {Object} timezone item with offset and name - * @returns {String} the UTC timezone with the offset, e.g. `[UTC + 2] Berlin` + * @returns {String} the UTC timezone with the offset, e.g. `[UTC+2] Berlin, [UTC 0] London` */ -export const formatTimezone = ({ offset, name }) => `[UTC ${formatUtcOffset(offset)}] ${name}`; +export const formatTimezone = ({ offset, name }) => `[UTC${formatUtcOffset(offset)}] ${name}`; |