Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

getDate is not defined #37

Open
idomiralin opened this issue Jun 4, 2020 · 1 comment
Open

getDate is not defined #37

idomiralin opened this issue Jun 4, 2020 · 1 comment

Comments

@idomiralin
Copy link

Version

1.0.5

Test Environment

Chrome

Current Behavior

I have added your example but I receive getDate is not defined.

Expected Behavior

@orvillelim
Copy link


const getDate = (type, start, value, operator) => {
  start = new Date(start);
  type = type.charAt(0).toUpperCase() + type.slice(1);

  if (operator === '+') {
    start[`set${type}`](start[`get${type}`]() + value);
  } else {
    start[`set${type}`](start[`get${type}`]() - value);
  }

  return start;
};

They have something like this in the repo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants