-
Notifications
You must be signed in to change notification settings - Fork 36
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
[WIP] Add full-width numbers support for Time
, Date
, DateTime
, DateRange
#907
[WIP] Add full-width numbers support for Time
, Date
, DateTime
, DateRange
#907
Conversation
@nsbarsukov Idk who to mention, but I have a question. Have you tried IME/Do you have IME on your input method? I am struggling with entering full-width numbers sometimes doesn't pass data, which is I can explain more in detail, but thinking about should I elaborate this to issue or slack something. If you guys have time, please take a light look about this. Thanks |
Yep, I've made some basic checks of IME to ensure that everything works fine. I will appreciate if you can help with it to make our library better) You can write me in Telegram: https://t.me/nsbarsukov |
I'm working on date (or also date related) processors to fix this: Screen.Recording.2024-01-26.at.17.19.22.mov |
@rikusen0335 Hello! I've finally refactored code to improve support of IME composition for built-in
Now it will work in the following way: new-way.movCould you rebase your branch, please ? |
['1', '1'], | ||
['18', '18'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use full-width characters ?
['1', '1'], | |
['18', '18'], | |
['1', '1'], | |
['18', '18'], |
}); | ||
}); | ||
|
||
describe('Should reject when invalid cases', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe('Should reject when invalid cases', () => { | |
describe('pads digits with zero if date segment exceeds its max possible value', () => { |
}); | ||
|
||
describe('Should reject when invalid cases', () => { | ||
// NOTE: months doesn't have 29, so it should prevents entering invalid month |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NOTE: months doesn't have 29, so it should prevents entering invalid month | |
// NOTE: months can be > 12 => pads the first 2 with zero |
.should('have.value', '2010/02') | ||
.should('have.prop', 'selectionStart', '2010/02'.length) | ||
.should('have.prop', 'selectionEnd', '2010/02'.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.should('have.value', '2010/02') | |
.should('have.prop', 'selectionStart', '2010/02'.length) | |
.should('have.prop', 'selectionEnd', '2010/02'.length); | |
.should('have.value', '2010/02/09') | |
.should('have.prop', 'selectionStart', '2010/02/09'.length) | |
.should('have.prop', 'selectionEnd', '2010/02/09'.length); |
Enable this test, please maskito/projects/kit/src/lib/masks/date/tests/date-mask.spec.ts Lines 70 to 71 in 8db69ff
( |
Will work on this for this weekend! Thank you for refactoring and sharing it! :)) |
Due to complexity (and also I forgot where was I fixing at), I moved PR to #1043 |
PR Type
What kind of change does this PR introduce?
What is the current behaviour?
Closes #884
This PR implements full-width to half-width preprocessor into time, or datetime or almost similar masks.
Please see issue page for more detail
What is the new behaviour?
Above masks will have full-width to half-width preprocessor.
Implementation
createFullWidthToHalfWidthPreprocessor
fromprojects/kit/src/lib/masks/number/processors
toprojects/kit/src/lib/processors
(also tests)createFullWidthToHalfWidthPreprocessor
toTime
,Date
,DateTime
,DateRange
masksAdded e2e tests forWIPTime
,Date
,DateTime
,DateRange
masks