https://github.com/abdizriel/validately-assessment
https://github.com/abdizriel/validately-assessment
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abdizriel/validately-assessment
- Owner: Abdizriel
- License: mit
- Created: 2018-08-14T16:22:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T16:26:03.000Z (about 7 years ago)
- Last Synced: 2024-12-30T23:32:08.737Z (10 months ago)
- Language: JavaScript
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Validately - Job Assessment
## Requirements
* [NodeJS](https://nodejs.org/en/download "NodeJS")
## Presteps
You have to use the following command to install dependencies:
```sh
npm install
```or if you have installed yarn
```sh
yarn
```See `package.json` for more details about used packages.
## Build for local development
You have to use the following command to start a development server:
```sh
npm run start
```or if you have installed yarn
```sh
yarn start
```## Build for staging and production environments
You have to use the following command to start a development server:
```sh
npm run build
```or if you have installed yarn
```sh
yarn build
```## Tests
Following tests libraries are used for unit/integration tests:
* [Enzyme](https://github.com/airbnb/enzyme "Enzyme")
* [Jest](https://jestjs.io/ "Jest")Tests are kept next to source with following pattern *.spec.js
Use following command to run tests:
```sh
npm test
```or if you have installed yarn
```sh
yarn test
```## Assessment solution description
Solution for that assessment is very simple. At the initialization of the application there's fired a redux action to get initial details about timezones throught moment-timezone library. Through that library application is guessing a user timezone and set current time as a default selected timezone based on which other timezones (including second default one GMT) times would be calculated.
Both of the timezones GMT and guessed user timezone is non deletable - user can't remove them but still can operate to calculate time in different timezones and highligh based on which timezone other timezones are calculated.
Each selected timezone is stored in Redux state and operations like modyfing time, adding new timezone and removing timezone is done in Redux actions.