question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using setHours and setMinutes

See original GitHub issue

I have this:

<DatePicker selected={this.state.startDate} onChange={this.handleChange} showTimeSelect minDate={new Date()} minTime={setHours(setMinutes(new Date(), 0), 7)} maxTime={setHours(setMinutes(new Date(), 0), 17)} filterDate={this.isWeekday} timeFormat="HH:mm" timeIntervals={30} dateFormat="d MMMM, yyyy h:mm aa" timeCaption="Hora" locale="es" />

But setHours and setMinutes throw an error. I am missing something? Also, with filterDate I want to allow only to select a weekday. Does anyone have the function for isWeekday?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

9reactions
no1lov3smecommented, Oct 23, 2019

@no1lov3sme The URL which you shared it’s throwing 404.

import setSeconds from "date-fns/setSeconds";
import setMinutes from "date-fns/setMinutes";

Source

0reactions
stale[bot]commented, Apr 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am trying use reactdatepicker, but I get error message that ...
I am trying use reactdatepicker, but I get error message that setHours is is not defined · Line 12:3: 'setHours' is not defined...
Read more >
Date.prototype.setHours() - JavaScript - MDN Web Docs
The setHours() method sets the hours for a specified date according to local time, and returns the number of milliseconds since January 1,...
Read more >
sethours() javascript function to fix hours part of date object
We have seen by using sethours we can fix the hours part to any value. This value is independent of present hours value....
Read more >
JavaScript Date setHours() Method - W3Schools
setHours () sets the hour of a date. setHours() can also set minutes, seconds and milliseconds. Example 2. Set the time to 15:35:01....
Read more >
Solved Change setHours and setMinutes to member functions.
Answer to Solved Change setHours and setMinutes to member functions. ... 22 23 24 25 26 Testers Running Tester.cpp Error: Tester.cpp: In function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found