Browse Source

support for 3 letter month search

Abhinav-grd 4 years ago
parent
commit
9dc799acb6
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/services/searchService.ts

+ 3 - 0
src/services/searchService.ts

@@ -17,11 +17,14 @@ export const getMapboxToken = () => {
 
 
 export function parseHumanDate(humanDate: string): DateValue[] {
 export function parseHumanDate(humanDate: string): DateValue[] {
     const date = chrono.parseDate(humanDate);
     const date = chrono.parseDate(humanDate);
+    const date1 = chrono.parseDate(humanDate + ' 1');
     if (date != null) {
     if (date != null) {
         return [
         return [
             { date: date.getDate(), month: date.getMonth() },
             { date: date.getDate(), month: date.getMonth() },
             { month: date.getMonth() },
             { month: date.getMonth() },
         ];
         ];
+    } else if (date1) {
+        return [{ month: date1.getMonth() }];
     } else {
     } else {
         return [];
         return [];
     }
     }