Adam Shaw 7 лет назад
Родитель
Сommit
ed56bd8a3f
2 измененных файлов с 5 добавлено и 3 удалено
  1. 2 2
      src/Calendar.ts
  2. 3 1
      src/validation.ts

+ 2 - 2
src/Calendar.ts

@@ -64,8 +64,8 @@ export default class Calendar {
 
   private buildDateEnv = memoize(buildDateEnv)
   private buildTheme = memoize(buildTheme)
-  private buildEventUiSingleBase = memoize(this._buildSelectionConfig)
-  private buildSelectionConfig = memoize(this._buildEventUiSingleBase)
+  private buildEventUiSingleBase = memoize(this._buildEventUiSingleBase)
+  private buildSelectionConfig = memoize(this._buildSelectionConfig)
   private buildEventUiBySource = memoizeOutput(buildEventUiBySource, isPropsEqual)
   private buildEventUiBases = memoize(buildEventUiBases)
 

+ 3 - 1
src/validation.ts

@@ -226,7 +226,7 @@ function isSegmentedSelectionValid(
       }
 
       if (overlapFunc && !overlapFunc(
-        new EventApi(calendar, relevantDefs.defs[relevantInstance.defId], relevantInstance)
+        new EventApi(calendar, relevantDefs[relevantInstance.defId], relevantInstance)
       )) {
         return false
       }
@@ -370,6 +370,8 @@ export function normalizeConstraint(input: ConstraintInput, calendar: Calendar):
   if (typeof input === 'object' && input) { // non-null object
     let span = parseOpenDateSpan(input, calendar.dateEnv)
 
+    // TODO: use parseEvent/parseEvents all the way
+    // but to do this, we need to allow open-range parsing
     if (span === null || span.range.start || span.range.end) {
       return span
     } else { // if completely-open range, assume it's a recurring event (prolly with startTime/endTime)