/date-formatter

Nivo solutions Tech test

Primary LanguageJavaScript

Coding Exercise

A very simple coding exercise using JavaScript

This exercise should take no more than 30 minutes to complete.

Objective

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 the current system date return the string 'TODAY'
  • When the date is not current system date return a formatted date string in the format 'DD/MM/YYYY'

Setup

  • 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.

Other Info

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

Useful Links

On Completion

To have completed code reviewed please send me the url to your fork of this repository that contains your completed code.