Allow `Datepicker` to use non-protected characters on `value-format`
Reproduction
https://formkit.com/playground?css-framework=genesis&fkv=latest&fileTab=schema-formkit.vue&files=jc%5B%28%27name%21%27Z-Q.vue%27%7Eeditor%21%27%3CscripTsetup944consTZ+%3D+%5B4O%28O7%24QNdGpickerPueFCVU7%2201.MM.YYYY%22labelNDGnameNdGPidVionNrequired%7CdG_after%3A2023-06-22placeholderNSelecteaz%C4%83+o+dV%C4%83overlay8true45%2944%5D4Bscript94%3CLI+typeHfCJ%23defaultHEJ%3AactionsHfalse7ISA+%3AZHZJ%2F95XprWwrap%3E%28E%29Bpre9BR9BL9%27%7Eadded%21true%29%5D7%2CO74%5Cn5++7%5C%278U+9%3E4AchemaB%3C%2FCormE%28+PuW%29GVeH%3D7I9XRJ7+LtemplGN87O455PvalQfCkitRFCKitTt+U%5C%21VatWe+X5%3CZsA%01ZXWVUTRQPONLJIHGECBA98754_&imports=jc%28%27name%21%27ImportMap%27%7Eeditor%21%27%28*+1vue%5C%211https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fvue%403%2Fdist%2Fvue.esm-browser.min.js0*%29*%27%29*%5Cn0%5C%271+0%0110
Describe the bug
Description When we use datepicker to only get the year and month, we'd like to format it to add our custom day. E.g.: "YYYY-MM-01"
Right now this will break the datepicker.
But if I put it in both double and single quotes, it works. But this is a work around and will need to remove this extra single quotes.
Environment
• Windows • Chrome • "@formkit/themes": "^0.17.5", • "@formkit/pro": "^0.115.2", But tested on latest version for reproduction
Huh..weird that it is somehow allowed with the quotes 😂 The crux of the issue is parsing out the numbers like when your format contains numeric dates can get really tricky — but perhaps we can have some signature to treat numbers characters, like an escape sequence or something.
Huh..weird that it is somehow allowed with the quotes 😂 The crux of the issue is parsing out the numbers like when your format contains numeric dates can get really tricky — but perhaps we can have some signature to treat numbers characters, like an escape sequence or something.
I'd say the numbers should have the same behavior as any other char, look for it into the token list, and if don't find it, just show it.
Well yes — I would say that too in an ideal world — unfortunately its a bit more complicated than that. You need literal values to distinguish tokens from characters. Take for example the format M-D with the value 1-21 We know the month is 1 and the day is 1 because the - literal is in between them — if the format was MD with 121 you could not know if it was month 12 and day 1 or month 1 and day 21. If we allow static numbers as literals we have the same problem. Consider the format M1D and the value 1111 what is the date?
This is why numbers are excluded from literal values and any attempt to add them would require some kind of special escape.
So do you need to recognize the format after generating the date, Like a reverse engineering? That's would be the a good reason to not allow any kind of format, I think.
If not...
I believe if the user used the M1D format and received `1111´, the tool did it great. The tool converted the tokens and showed the non-token characters.
The tool is limiting formats because doesn't understand the reason users would want to use those formats.