A very simple coding exercise using JavaScript
This exercise should take no more than 30 minutes to complete.
Implement the format
method in the file dateFormatter.js
const format = (dateToFormatTimeMillis, systemDateTimeMillis) => {}
The format
method takes a datetime to format
and the current system datetime
in milliseconds as inputs.
The format
method implementation should return a formatted string as follows:
- When the date is todays date return the string
'TODAY'
- When the date is not todays date return a formatted date string in the format
'DD/MM/YYYY'
- Fork this repository into your own github account
- Clone your fork of the repository to work on it locally
- Run yarn (or npm install) in the project directory to install/configure the project
- Implement the
format
method in the file dateFormatter.js - Push your completed work back to your github fork
- Send me the url for the github fork where your completed work is.
A test case has been provided that will help guide you. This is in the file dateFormatterTest.js
You can add more tests to help you.
To run the tests run the command
yarn test
Feel free to use any libraries that you want to help you by adding them to the package.json file
To have completed code reviewed please send me the url to your fork of this repository that contains your completed code.