Skip to content

Commit

Permalink
if same day -
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeyyyzhao committed Feb 21, 2024
1 parent 7effc72 commit edc863a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"./dist/react-big-calendar.js": {
"bundled": 543609,
"minified": 167855,
"gzipped": 51575
"bundled": 545956,
"minified": 168840,
"gzipped": 51916
},
"./dist/react-big-calendar.min.js": {
"bundled": 471477,
"minified": 146012,
"gzipped": 45768
"bundled": 473824,
"minified": 147009,
"gzipped": 46084
},
"dist/react-big-calendar.esm.js": {
"bundled": 226542,
"minified": 102424,
"gzipped": 25443,
"bundled": 226875,
"minified": 102569,
"gzipped": 25479,
"treeshaked": {
"rollup": {
"code": 64993,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rbc-fork-react-big-calendar",
"version": "0.33.17",
"version": "0.33.18",
"description": "Calendar! with events",
"author": {
"name": "Jason Quense",
Expand Down
10 changes: 10 additions & 0 deletions src/localizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ function sortEvents({
let durA = daySpan(aStart, aEnd)

let durB = daySpan(bStart, bEnd)

if (startSort === 0) {
// same day
return (
!!bAllDay - !!aAllDay || // allDay single events go first
durB - durA || // events spanning multiple days go first
+aStart - +bStart || // then sort by start time
+aEnd - +bEnd // then sort by end time
)
}

return (
startSort || // sort by start Day first
Expand Down

0 comments on commit edc863a

Please sign in to comment.