Explorar el Código

support for 3 letter month search

Abhinav-grd hace 4 años
padre
commit
9dc799acb6
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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[] {
     const date = chrono.parseDate(humanDate);
+    const date1 = chrono.parseDate(humanDate + ' 1');
     if (date != null) {
         return [
             { date: date.getDate(), month: date.getMonth() },
             { month: date.getMonth() },
         ];
+    } else if (date1) {
+        return [{ month: date1.getMonth() }];
     } else {
         return [];
     }