diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3094e921..acf3c9e8 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -40,7 +40,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: wri/fti_api
- ref: feature/newsletter-history
+ ref: master
path: otp_api
- name: Save OTP API Commit SHA
diff --git a/pages/newsletter.js b/pages/newsletter.js
index 039289eb..095da138 100644
--- a/pages/newsletter.js
+++ b/pages/newsletter.js
@@ -14,7 +14,7 @@ import API from 'services/api';
const JSONA = new Jsona();
-const Newsletter = ({ url, newsletters }) => {
+const Newsletter = ({ url, newsletters, language }) => {
const intl = useIntl();
return (
@@ -47,7 +47,7 @@ const Newsletter = ({ url, newsletters }) => {
// genereate newsletter card with image on top and title and description below
-
+
@@ -56,7 +56,7 @@ const Newsletter = ({ url, newsletters }) => {
- {new Date(newsletter.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', timeZone: 'UTC' })}
+ {new Date(newsletter.date).toLocaleDateString(language, { year: 'numeric', month: 'long', timeZone: 'UTC' })}
{newsletter["short-description"]}
@@ -77,7 +77,8 @@ const Newsletter = ({ url, newsletters }) => {
Newsletter.propTypes = {
url: PropTypes.shape({}).isRequired,
- newsletters: PropTypes.array.isRequired
+ newsletters: PropTypes.array.isRequired,
+ language: PropTypes.string.isRequired
};
Newsletter.getInitialProps = async ({ url, store }) => {
const { language } = store.getState();
@@ -85,7 +86,7 @@ Newsletter.getInitialProps = async ({ url, store }) => {
.get('newsletters', { locale: language })
.then((response) => JSONA.deserialize(response));
- return { url, newsletters };
+ return { url, newsletters, language };
}