Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
fix webpage autocite date parsing. #418
Browse files Browse the repository at this point in the history
  • Loading branch information
dsifford committed Jan 23, 2018
1 parent d6d372a commit 8cbf8e3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
22 changes: 11 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@babel/preset-react": "^7.0.0-beta.37",
"@types/classnames": "^2.2.3",
"@types/common-tags": "^1.4.0",
"@types/enzyme": "^3.1.6",
"@types/enzyme": "^3.1.7",
"@types/enzyme-adapter-react-16": "^1.0.1",
"@types/gulp": "^4.0.5",
"@types/gulp-replace": "0.0.31",
Expand All @@ -61,7 +61,7 @@
"custom-event-polyfill": "^0.3.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.0",
"enzyme-to-json": "^3.3.0",
"enzyme-to-json": "^3.3.1",
"extract-text-webpack-plugin": "^3.0.2",
"gulp": "^4.0.0",
"gulp-replace": "^0.6.1",
Expand Down Expand Up @@ -93,7 +93,7 @@
"tslint-config-prettier": "^1.6.0",
"tslint-microsoft-contrib": "^5.0.2",
"tslint-react": "^3.4.0",
"uglify-es": "^3.3.7",
"uglify-es": "^3.3.8",
"uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0",
"whatwg-fetch": "^2.0.3"
Expand Down
9 changes: 8 additions & 1 deletion src/js/utils/resolvers/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ function parseDateString(input: string): string {
return '';
}
const date = new Date(input);
const [month, day, year] = date.toLocaleDateString('en-US').split('/');
const [month, day, year] = date
.toLocaleDateString('en-US', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
timeZone: 'UTC',
})
.split('/');
return `${year}/${month}/${day}`;
}

0 comments on commit 8cbf8e3

Please sign in to comment.