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
Generator a union that can suport time format type #13015
Comments
#13016 - Pull Request updated. |
// 时间格式的定义 type TTimeTuple = ['YYYY', 'MM', 'DD', 'HH', 'mm', 'ss', ''] type TSeparators<T, Separators extends string> = T extends T declare type TTimeFormat< |
Info
Basic info of your challenge questions,
Question
Generator a union that can suport time format type
For example, the function component named 'timePicker' with time params like value、onChange. we need a union type like
'YYYY-MM-DD HH:mm:ss'|'YYYY-MM-DD'|'HH:mm:ss'|'YYYY-MM HH:ss'|...
notstring
, but can be""
Template
This is the template for challengers to start the coding. Basically, you just need to change the name of your generic/function and leave to implementation
any
.Test Cases
Provide some test cases for your challenge, you can use some utils from
@type-challenges/utils
for asserting.The text was updated successfully, but these errors were encountered: