Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add business days #279

Open
marcwales opened this issue Nov 17, 2021 · 0 comments
Open

Add business days #279

marcwales opened this issue Nov 17, 2021 · 0 comments

Comments

@marcwales
Copy link

marcwales commented Nov 17, 2021

Hi,

I hope this is still active, i was using the original datejs for years but now i see this upgrade which i needed since the beginning ;) I just can't seem to make it work. Here is the original code :

  <script>
  var fromDate = Date.today().addDays(5);
  if (fromDate.is().saturday() || fromDate.is().sunday()) { 
  fromDate = fromDate.next().monday();
  }
  var toDate = Date.today().addDays(10);
  if (toDate.is().saturday() || toDate.is().sunday()) { 
  toDate = toDate.next().monday(); 
  }
  document.getElementById('fromDate').innerHTML = fromDate.toString('dddd dd-MM-yyyy');
  document.getElementById('toDate').innerHTML = toDate.toString('dddd MMMM dS');
  </script> 

I tired to change this : var fromDate = Date.today().addWeekdays(5);

But it doesn't work.

Hope someone can help me on this.

Rgds,
Marc

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

No branches or pull requests

1 participant