Skip to content

Conversation

@yagop
Copy link
Contributor

@yagop yagop commented Oct 31, 2019

No description provided.

Copy link
Contributor

@nanov nanov left a comment

Choose a reason for hiding this comment

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

Great enchainment, I would do it a little more verbose, or alternately drop moment.js dependency as a whole. moment.js is used only to format dates on two places, as we are using rather simple ISO formatting the same can be achieved fairly easily with the standard Date.

const dateRange = (start, end) => {
if (start && end)
if (start && end) {
if (start instanceof Date) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Something like moment(start).isValid() be more generic.
If we drop moment, than something like this:

const startDate = new Date(start);
if (isNaN(startDate)) throw new Error('Invalid start date`);
const formatedStartDate = helperFormatter(startDate);

nanov added a commit that referenced this pull request Nov 7, 2019
@nanov
Copy link
Contributor

nanov commented Nov 7, 2019

Solved with v0.1.2

@nanov nanov closed this Nov 7, 2019
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.

2 participants