Skip to content

Commit

Permalink
add timestamp to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
tischrei committed May 13, 2024
1 parent 4e583b7 commit 1455844
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import Link from 'next/link'
import React from 'react';
import styles from '/styles/Footer.module.css';
import { usePathname } from 'next/navigation'


function Footer() {
const pathname = usePathname();
var locale = pathname.split('/')[1];
Expand Down Expand Up @@ -32,11 +34,24 @@ function Footer() {
'imprint_link': 'https://www.open-telekom-cloud.com/en/imprint',
}
}

// create timestamp
var timestamp = new Date().toLocaleString();

if (locale === 'de') {
timestamp = `Zuletzt aktualisiert: ${timestamp}`
} else {
timestamp = `Last Updated: ${timestamp}`
}

return (
<scale-telekom-footer slot="footer">
<scale-telekom-footer-content>
<span slot="notice">© {new Date().getFullYear()} T-Systems International GmbH</span>
<ul slot="navigation">
<li class={styles.timestamp}>
{timestamp}
</li>
<li>
<Link href={`${data[locale].commission_link}`}>{`${data[locale].commission}`}</Link>
</li>
Expand Down
3 changes: 3 additions & 0 deletions styles/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.timestamp{
color: var(--telekom-color-text-and-icon-white-additional);
}

0 comments on commit 1455844

Please sign in to comment.