fix: various fixes and date zero-padded feature

This commit is contained in:
David Ralph
2021-04-17 11:17:46 +01:00
parent de417f5fd1
commit 6573ba9553
12 changed files with 74 additions and 35 deletions

View File

@@ -106,7 +106,7 @@ export default class Quote extends React.PureComponent {
}
let authorlink = `https://${window.languagecode.split('_')[0]}.wikipedia.org/wiki/${data.author.split(' ').join('_')}`;
if (localStorage.getItem('authorLink') === 'false') {
if (localStorage.getItem('authorLink') === 'false' || data.author === 'Unknown') {
authorlink = null;
}

View File

@@ -44,8 +44,10 @@ export default class DateWidget extends React.PureComponent {
const dateMonth = date.getMonth() + 1;
const dateYear = date.getFullYear();
let day = dateDay;
let month = dateMonth;
const zero = (localStorage.getItem('datezero') === 'true');
let day = zero ? ('00' + dateDay).slice(-2) : dateDay;
let month = zero ? ('00' + dateMonth).slice(-2) : dateMonth;
let year = dateYear;
switch (localStorage.getItem('dateFormat')) {