Browse Source

fix Event import

tripeur 4 years ago
parent
commit
42a9dcb404
3 changed files with 4 additions and 4 deletions
  1. 2 2
      lib/Event.js
  2. 0 0
      lib/Event.js.map
  3. 2 2
      src/Event.ts

+ 2 - 2
lib/Event.js

@@ -65,11 +65,11 @@ class Event {
         }
         const start = dayjs_1.default(obj.start);
         const end = dayjs_1.default(obj.end);
-        if (start.isValid()) {
+        if (!start.isValid()) {
             throw new Error(`Error during the import of the Event '${obj.id}': Invalid starting date`);
         }
         else {
-            if (end.isValid()) {
+            if (!end.isValid()) {
                 throw new Error(`Error during the import of the Event '${obj.id}': Invalid ending date`);
             }
             else {

File diff suppressed because it is too large
+ 0 - 0
lib/Event.js.map


+ 2 - 2
src/Event.ts

@@ -92,10 +92,10 @@ export class Event implements IEvent, Selectable{
 
         const start = dayjs(obj.start)
         const end = dayjs(obj.end)
-        if(start.isValid()){
+        if(!start.isValid()){
             throw new Error(`Error during the import of the Event '${obj.id}': Invalid starting date`)
         }else{
-        if(end.isValid()){
+        if(!end.isValid()){
             throw new Error(`Error during the import of the Event '${obj.id}': Invalid ending date`)
         }else{
             

Some files were not shown because too many files changed in this diff