Skip to content

Commit

Permalink
fix [Bug]: 时间字段默认值配置为公式NOW()时保存的字段值,日期部分不应该为当天 #6509
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Feb 28, 2024
1 parent 4f7a788 commit 26f0f7b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/@steedos-widgets/steedos-lib/src/ui/defaultValue.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* @LastEditTime: 2023-11-03 16:54:54
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
* @LastEditTime: 2024-02-28 15:11:29
* @LastEditors: baozhoutao@steedos.com
* @customMade: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import * as _ from 'lodash';
import { isFunction, isNumber, isBoolean, isString, isNil } from 'lodash';
import { isFunction, isNumber, isBoolean, isString, isNil, isDate } from 'lodash';
import { safeRunFunction, safeEval } from '../utils';
import { isExpression, parseSingleExpression } from '../expression';

Expand Down Expand Up @@ -115,6 +115,10 @@ export const getFieldDefaultValue = (field, globalData) => {
defaultValue = false;
}
break;
case 'time':
if(isDate(defaultValue)){
return moment(defaultValue).format('1970-01-01THH:mm:00.000[Z]')
}
default:
break;
}
Expand Down

0 comments on commit 26f0f7b

Please sign in to comment.