Skip to content

Commit

Permalink
feat(NewsSlider): standardize date format with time zone in sliders
Browse files Browse the repository at this point in the history
Standardized the locale date string format to include the time zone 'UTC' for both WhiteDesktopSlider and WhiteMobileSlider components. Improved consistency across desktop and mobile news sliders when displaying dates.
  • Loading branch information
kleberbaum committed Dec 29, 2023
1 parent 1330423 commit 3b9c039
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/liba/components/NewsSlider/WhiteDesktopSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ const WhiteDesktopSlider: FC<IWhiteDesktopSliderProps> = ({
{page.jaenPageMetadata?.blogPost?.date
? new Date(
page.jaenPageMetadata.blogPost.date
).toLocaleDateString('de-de')
).toLocaleDateString('de-DE', {
year: 'numeric',
month: 'long',
day: 'numeric',
timeZone: 'UTC'
})
: null}
</Text>
<Heading
Expand Down
3 changes: 2 additions & 1 deletion src/liba/components/NewsSlider/WhiteMobileSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ const WhiteMobileSlider: FC<IWhiteMobileSliderProps> = ({index}) => {
).toLocaleDateString('de-DE', {
year: 'numeric',
month: 'long',
day: 'numeric'
day: 'numeric',
timeZone: 'UTC'
})
: null}
</Text>
Expand Down

0 comments on commit 3b9c039

Please sign in to comment.