Просмотр исходного кода

Update regular expression to include more types of dates

arvid-e 9 месяцев назад
Родитель
Сommit
da6e8f776b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      apps/app/src/utils/axios.ts

+ 1 - 1
apps/app/src/utils/axios.ts

@@ -6,7 +6,7 @@ import qs from 'qs';
 // eslint-disable-next-line no-restricted-imports
 // eslint-disable-next-line no-restricted-imports
 export * from 'axios';
 export * from 'axios';
 
 
-const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;
+const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(Z|[+-]\d{2}:\d{2})$/;
 
 
 export function convertDateStringsToDates(data: any): any {
 export function convertDateStringsToDates(data: any): any {
   if (typeof data !== 'object' || data === null) {
   if (typeof data !== 'object' || data === null) {