maskito
maskito copied to clipboard
🚀 - `Date` add support for multi-character `separator`
Which package(s) are relevant/related to the feature request?
@maskito/kit
Description
-
export declare type MaskitoDateMode = 'dd/mm/yyyy' | 'mm/dd/yyyy' | 'mm/yy' | 'yyyy/mm/dd';
- In Slovenia we use formal format dd. mm. yyyy, but technically dd.mm.yyyy could you add this union type to MaskitoDateMode
@sysmat you can use parameter separator
to get desired format dd.mm.yyyy
import {maskitoDateOptionsGenerator} from '@maskito/kit';
const dateOptions = maskitoDateOptionsGenerator({
mode: 'dd/mm/yyyy',
separator: '.'
}); // dd.mm.yyyy
I see that you also need dd. mm. yyyy
format (with spaces).
At present time, separator
parameter supports only single character.
Let convert this issue to
`Date` add support for multi-character `separator`
Expected behaviour:
const dateOptions = maskitoDateOptionsGenerator({
mode: 'dd/mm/yyyy',
separator: '. ' // 2 characters
}); // dd. mm. yyyy
const today = new Date();
console.log(
new Intl.DateTimeFormat('sl-SI').format(today)
); // 29. 6. 2023
@nsbarsukov thx
Is @KrollikRoddzer working on this? I was debugging this rn so not sure if I continue or wait it
Is @KrollikRoddzer working on this? I was debugging this rn so not sure if I continue or wait it
@wladpaiva Actually, we just planned for him to do it. He has not started doing this yet. So, if you are already debugging this issue and want to contribute – welcome ❤️
I will re-assign this issue to you!
@nsbarsukov, @sysmat it can be already done https://stackblitz.com/edit/stackblitz-starters-nkq2rt?file=date-mask.spec.js
@kmisha Unfortunately, it is not yet supported(
Try to enter any complete date string here: https://maskito.dev/kit/date/API?separator=--
Oh, I see. May I try to fix it?
@kmisha thx, nice
Oh, I see. May I try to fix it?
Of course!