Number of Events working Correctly

master
Pedram Keshavarzi 3 years ago
parent a5ca336e39
commit 60624da2a2
  1. 38
      src/components/Calendar/CalendarComponents/components/DaysList.js

@ -256,43 +256,30 @@ const DaysList = ({
isStandard,
});
// showing Dots Of Events
const specialDate = (sDay, sMonth, sYear) => {
for (var i = 0; i < events.length; i++) {
if (sDay == events[i].day && sMonth == events[i].month && sYear == events[i].year) {
return (sDay, sMonth, sYear);
return events.map((e) => {
if (sDay == e.day && sMonth == e.month && sYear == e.year) {
return '.';
}
}
})
};
const logEachDateDes = (sDay, sMonth, sYear) =>{
return events.map((e) =>{
const showEventDescription = (sDay, sMonth, sYear) => {
return events.map((e) => {
if (sDay == e.day && sMonth == e.month && sYear == e.year) {
return <p key={'description' + e.id}>{e.description}</p>
return (<div key={'description' + e.id}><p>{e.description}</p></div>)
}
})
}
const showEventDescription = (sDay , sMonth, sYear) => {
for (var i = 0; i < events.length; i++) {
if (sDay == events[i].day && sMonth == events[i].month && sYear == events[i].year) {
return(events[i].description);
}
}
}
return (
<div
@ -308,8 +295,8 @@ const DaysList = ({
handleDayPress({ ...dayItem, isDisabled });
// console.log(specialDate(day));
// console.log(showEventDescription(day))
// showEvent(showEventDescription(day, month, year))
showEvent(logEachDateDes(day, month, year))
showEvent(showEventDescription(day, month, year))
}}
onKeyDown={({ key }) => {
/* istanbul ignore else */
@ -327,7 +314,8 @@ const DaysList = ({
data-is-default-selectable={shouldEnableKeyboardNavigation}
>
{!isStandard ? '' : getLanguageDigits(day)}
{specialDate(day, month, year) == (day, month, year) ? <span>.</span> : ' '}
{/* Dots Of Events */}
<span>{specialDate(day, month, year)}</span>
</div>
);
};

Loading…
Cancel
Save