mirror of
https://github.com/mue/mue.git
synced 2026-07-18 06:24:17 +02:00
refactor and fix some things
This commit is contained in:
@@ -22,8 +22,10 @@ export default class Clock extends React.PureComponent {
|
||||
if (localStorage.getItem('percentageComplete') === 'true') return this.setState({ time: (now.getHours() / 24).toFixed(2).replace('0.', '') + '%'});
|
||||
|
||||
// Analog clock
|
||||
if (localStorage.getItem('analog') === 'true') this.setState({ time: now });
|
||||
else {
|
||||
if (localStorage.getItem('analog') === 'true') {
|
||||
require('react-clock/dist/Clock.css');
|
||||
this.setState({ time: now });
|
||||
} else {
|
||||
let time, sec = '';
|
||||
|
||||
// Extra 0
|
||||
|
||||
@@ -11,6 +11,7 @@ export default class DateWidget extends React.PureComponent {
|
||||
|
||||
getDate() {
|
||||
const date = new Date();
|
||||
|
||||
const short = localStorage.getItem('short');
|
||||
const dateFormat = localStorage.getItem('dateFormat');
|
||||
|
||||
@@ -54,7 +55,6 @@ export default class DateWidget extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (localStorage.getItem('date') === 'false') return;
|
||||
this.getDate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user