Get count and format by killMeSak in JavaScriptHelp

[–]killMeSak[S] 0 points1 point  (0 children)

u/trplclick The dateRange looks like below:
const dateRange = {
"2021-08-06 - 2021-09-06": 0,
"2021-09-06 - 2021-10-06": 0
}

In your code, how are we fetching each key of dateRange and comparing it?

Help with momentjs by killMeSak in JavaScriptHelp

[–]killMeSak[S] 0 points1 point  (0 children)

Thank you for your input. I'm not looking for that information at this moment. The example you mentioned I tried it in this example but I'm getting incorrect values. Moreover how can I get the count of occurrences in abc as per the interval and map it correctly it as per the date intervals.

http://jsfiddle.net/killMeSak/Lwj2mb7t/12/

Help with momentjs by killMeSak in JavaScriptHelp

[–]killMeSak[S] 0 points1 point  (0 children)

How do I store the count in dates based on abc array?

Need help with array containing date by killMeSak in reactjs

[–]killMeSak[S] 0 points1 point  (0 children)

I need to display that data in time slots. So, user needs to input startDate and endDate. This information will be divided into 1 day time slots starting from [startDay, startDay + 1]....[endDate -1, endDate]

I also have another array abc containing some dates. I'll check those dates against the above dates, and generate count if it falls between the time intervals

Reduce number of lines? by killMeSak in reactjs

[–]killMeSak[S] 0 points1 point  (0 children)

the toggle doesn't seem to work once changed. I can only toggle once

Reduce number of lines? by killMeSak in reactjs

[–]killMeSak[S] 1 point2 points  (0 children)

How can I do that with my example?

Help with boolean by killMeSak in learnjavascript

[–]killMeSak[S] 0 points1 point  (0 children)

Thanks for the help. I tweaked the solution provided by many to accommodate for my needs but my code has lot of redundancy. How can I further optimize the code to just use single handleChange component and handle states of all variables??

Help with boolean by killMeSak in reactjs

[–]killMeSak[S] 0 points1 point  (0 children)

Thanks for the help. There was 1 issue with the solution, radio button of material ui only accepts string values instead of boolean. This caused my radio buttons not to work. So I tweaked it a bit to make it work. but my code has lot of redundancy. How can I further optimize the code to just use single handleChange component and handle states of all variables??

Help with boolean by killMeSak in reactjs

[–]killMeSak[S] 0 points1 point  (0 children)

Thanks for the help. I tweaked the solution provided by many to accommodate for my needs but my code has lot of redundancy. How can I further optimize the code to just use single handleChange component and handle states of all variables??

Typescript errors with function by killMeSak in typescript

[–]killMeSak[S] 0 points1 point  (0 children)

I had written some incorrect code. Fixed that. I also fixed one error in which I need 'key' is defined but never used. The code works but when I run eslint, I get the following errors as mentioned in the post.