ywana-core8 0.0.950 → 0.0.952

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.950",
3
+ "version": "0.0.952",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -98,21 +98,25 @@ export const Planner2 = ({ from, to, lanes = [], events = [], cellWidth = 10, ro
98
98
  {lanes.map((lane, index) => {
99
99
  const laneEvents = events.filter((event) => event.lane === lane.id);
100
100
 
101
- if (hideEmptyRows) {
102
-
103
- // find days with event for this lane
104
- const daysWithEvents = laneEvents.map(event => {
105
- const eventDate = new Date(event.date);
106
- return `${eventDate.getFullYear()}-${eventDate.getMonth() + 1}-${eventDate.getDate()}`;
107
- });
101
+ if (hideEmptyRows && lane.className !== "separator" ) {
108
102
 
109
- if (daysWithEvents.length === 0) {
110
- return null;
111
- }
103
+ if (laneEvents.length === 0) return null;
104
+
105
+ // find days with event for this lane in the period
106
+ const daysWithEvents = days.filter(({ day, monthNum, year }) => {
107
+ return laneEvents.find((event) => {
108
+ const eventDate = new Date(event.date);
109
+ return eventDate.getDate() === day &&
110
+ eventDate.getMonth() === monthNum - 1 &&
111
+ eventDate.getFullYear() === year;
112
+ });
113
+ })
114
+
115
+ // if no days with events, skip this lane
116
+ if (daysWithEvents.length === 0) return null;
112
117
 
113
118
  }
114
119
 
115
-
116
120
  return (
117
121
  <div className={`content-row ${lane.className}`} style={{ width: `${totalDaysWidth}rem` }}>
118
122
  <div className="row-header" style={{ minWidth: `${rowHeaderWidth}rem`, maxWidth: `${rowHeaderWidth}rem` }} >
@@ -192,7 +196,7 @@ const CalendarTest = (props) => {
192
196
 
193
197
  return (
194
198
  <>
195
- <Planner2 from="2024-01-01" to="2024-12-01" lanes={lanes} events={events} EventRenderer={EventCard} hideEmptyRows />
199
+ <Planner2 from="2024-01-01" to="2024-02-01" lanes={lanes} events={events} EventRenderer={EventCard} hideEmptyRows />
196
200
  </>
197
201
  )
198
202
  }
@@ -25,7 +25,6 @@ export const Planner = ({ title, events = [], lanes = [], navigation = true, onS
25
25
 
26
26
  const gotoMonday = useCallback(node => {
27
27
  const element = node
28
- console.log("goto monday", element)
29
28
  if (element) element.scrollIntoView({
30
29
  behavior: 'smooth',
31
30
  block: 'start',