Skip to content

Commit

Permalink
Merge pull request #390 from UKHomeOffice/389-bug-dates-are-in-americ…
Browse files Browse the repository at this point in the history
…an-format

Use UK formatted date for postDate filter
  • Loading branch information
jeff-horton-ho-sas authored Mar 15, 2024
2 parents 52e8648 + d46c120 commit 32a3d58
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function(eleventyConfig) {
});

eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_FULL);
return DateTime.fromJSDate(dateObj).toFormat('d MMMM yyyy');
});

// Used for tag page generation
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ FROM node:20.11.1-alpine AS build
COPY . .

RUN apk update && apk upgrade && \
apk add --no-cache git
apk add --no-cache git tzdata

ENV SITE_ROOT "https://engineering.homeoffice.gov.uk/"
RUN ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

ENV SITE_ROOT="https://engineering.homeoffice.gov.uk/" \
LANG="en_GB.UTF-8"

RUN npm ci --omit=dev
RUN npm run build
Expand Down
27 changes: 14 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
},
"dependencies": {
"@11ty/eleventy": "^2.0.1",
"@x-govuk/govuk-eleventy-plugin": "^6.1.0"
"@x-govuk/govuk-eleventy-plugin": "^6.1.0",
"luxon": "^3.4.4"
},
"devDependencies": {
"axe-core": "^4.8.4",
Expand Down

0 comments on commit 32a3d58

Please sign in to comment.