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

🚀 - Date add support for multi-character separator #353

Closed
sysmat opened this issue Jun 29, 2023 · 11 comments · Fixed by #1306
Closed

🚀 - Date add support for multi-character separator #353

sysmat opened this issue Jun 29, 2023 · 11 comments · Fixed by #1306
Assignees
Labels
contributions welcome Architecture is clear and community can help feature New feature or request P2 This issue has medium priority scope: kit Related to @maskito/kit

Comments

@sysmat
Copy link

sysmat commented Jun 29, 2023

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 sysmat added the feature New feature or request label Jun 29, 2023
@nsbarsukov
Copy link
Member

@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

@nsbarsukov
Copy link
Member

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

@nsbarsukov nsbarsukov changed the title 🚀 - MaskitoDateMode Slovenia format 🚀 - Date add support for multi-character separator Jun 29, 2023
@nsbarsukov nsbarsukov added the scope: kit Related to @maskito/kit label Jun 29, 2023
@nsbarsukov
Copy link
Member

const today = new Date();

console.log(
  new Intl.DateTimeFormat('sl-SI').format(today)
); // 29. 6. 2023

@nsbarsukov nsbarsukov added the P2 This issue has medium priority label Jun 29, 2023
@sysmat
Copy link
Author

sysmat commented Jun 29, 2023

@nsbarsukov thx

@wladpaiva
Copy link

Is @KrollikRoddzer working on this? I was debugging this rn so not sure if I continue or wait it

@nsbarsukov
Copy link
Member

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 nsbarsukov added the contributions welcome Architecture is clear and community can help label Apr 24, 2024
@kmisha
Copy link

kmisha commented Jun 6, 2024

@nsbarsukov, @sysmat it can be already done https://stackblitz.com/edit/stackblitz-starters-nkq2rt?file=date-mask.spec.js

@nsbarsukov
Copy link
Member

@kmisha Unfortunately, it is not yet supported(

Try to enter any complete date string here:
https://maskito.dev/kit/date/API?separator=--

@kmisha
Copy link

kmisha commented Jun 6, 2024

Oh, I see. May I try to fix it?

@sysmat
Copy link
Author

sysmat commented Jun 7, 2024

@kmisha thx, nice

@sysmat sysmat closed this as completed Jun 7, 2024
@nsbarsukov nsbarsukov reopened this Jun 7, 2024
@nsbarsukov
Copy link
Member

Oh, I see. May I try to fix it?

Of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome Architecture is clear and community can help feature New feature or request P2 This issue has medium priority scope: kit Related to @maskito/kit
Projects
No open projects
Status: 💡 Backlog
5 participants