Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update world clock widget #47

Merged
merged 14 commits into from
Sep 16, 2019

Conversation

michalskrzypek
Copy link
Contributor

  • added new date formats,
  • separated date formats from time formats,
  • added differentation between 24- and 12-hour clock
  • changed datetime display in widget,
  • added option to enable/disable display of date and time,
  • moved constants and helpers related to WC widget to the adequate file.

@@ -40,3 +12,7 @@ export const sortByKey = (obj, key, asc = true) => Object.entries(obj)

return newObj;
}, {});

Array.prototype.insert = function ( index, item ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding methods to build in objects prototypes is considered a bad idea. These are reserved for internal language features. Please create an util function.

const date = getDateTime(timeZoneId, dateFormat);

const initTime = getDateTime(timeZoneId, timeFormat);
let [time, setTime] = useState(initTime);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const here, you won't reassign these values i suppose.

@@ -1,24 +1,41 @@
import React, {useState} from 'react';
import Typography from "@material-ui/core/Typography/index";
import {string} from "prop-types";
import {Typography} from "@material-ui/core";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to components imports. I remind that you have 3 types of imports in the following order: libs, internal helpers/actions/hooks, components: 3rd party/own.

@michalskrzypek michalskrzypek merged commit 03c9ca8 into master Sep 16, 2019
Cich0sza pushed a commit that referenced this pull request Sep 23, 2019
@michalskrzypek michalskrzypek deleted the feature/update-world-clock-widget branch October 28, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants