taiga-family/maskito

๐Ÿž - `Date` formatting errors in `mm/yy`, `mm/yyyy`, `yyyy/mm`.

KrollikRoddzer opened this issue ยท 0 comments

Which package(s) are the source of the bug?

@maskito/kit

Playground Link

https://stackblitz.com/edit/flftyp-qv43ht?file=index.html

Description

import { maskitoDateOptionsGenerator } from '@maskito/kit';

export default maskitoDateOptionsGenerator({
  mode: 'mm/yyyy',
  separator: '.',
});
  1. Enter "12." into input - as a result, the value is "12.00", but "12." is expected
  2. Enter "1." into input - as a result, the value is "10.0", but "10." or "1" is expected
  3. Enter "1.2..." into input - as a result, the value is "10.0200"
import { maskitoDateOptionsGenerator } from '@maskito/kit';

export default maskitoDateOptionsGenerator({
  mode: 'yyyy/mm',
  separator: '.',
});
  1. Enter "1." into input - as a result, the value is "1000.0", but "1000." or "0001." is expected
import { maskitoDateOptionsGenerator } from '@maskito/kit';

export default maskitoDateOptionsGenerator({
  mode: 'mm/yy',
  separator: '.',
});
  1. Enter "12." into input - as a result, the value is "12", but "12." is expected
  2. Enter "1." into input - as a result, the value is "10.0", but "10." or "1" is expected

Maskito version

2.2.0

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android