From 2882bea63dbb474795f844e0559e3e4663a18d4a Mon Sep 17 00:00:00 2001 From: Kazuki Imamura Date: Mon, 7 Jun 2021 19:43:36 +0900 Subject: [PATCH] =?UTF-8?q?removeEmpty=E3=81=A7Date=E5=9E=8B=E3=81=8C?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=81=95=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=86=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/remove.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/remove.js b/src/utils/remove.js index 18cfdae6..626d8da7 100644 --- a/src/utils/remove.js +++ b/src/utils/remove.js @@ -2,8 +2,8 @@ import _ from 'lodash' export const removeEmpty = (obj) => { return _.transform(obj, function (result, value, key) { - if (!_.isEmpty(value) || _.isBoolean(value)) { - if (typeof value === 'object') { + if (!_.isEmpty(value) || _.isBoolean(value) || _.isDate(value)) { + if (typeof value === 'object' && !_.isDate(value)) { result[key] = removeEmpty(value) } else { result[key] = value