Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DatePicker2): support defaultValue for quarter, close #3006 #4985

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

mwb-27
Copy link
Contributor

@mwb-27 mwb-27 commented Nov 22, 2024

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是您为 Fusion/Next 提的第一个 pr,感谢您为 Fusion 做出的贡献,我们会尽快进行处理。

@mwb-27 mwb-27 force-pushed the fix-issue-3006 branch 4 times, most recently from 71a3e4b to ef1f4a0 Compare December 3, 2024 07:38
@zyliang96 zyliang96 self-requested a review December 3, 2024 08:34
@@ -1,6 +1,7 @@
import type { ConfigType, OptionType, Dayjs } from 'dayjs';
import { isPromise } from './object';
import datejs from './date';
import { isArray } from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是直接用Array.isArray 就可以处理了,不用引入lodash

/**
* 字符型日期转为dayjs类型
*/
export function getValueWithDayjs(val: ConfigType | ConfigType[], format: OptionType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的返回类型最好标注一下,下面的方法一样

let date = val;

if (isArray(val)) {
date = [0, 1].map(index => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方直接对date做处理就好了,取[0,1]就限制了长度,工具方法不通用

@zyliang96 zyliang96 merged commit fcb7abd into alibaba-fusion:next Dec 6, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants