jsonform / jsonform

Build forms from JSON Schema. Easily template-able. Compatible with Bootstrap 3 out of the box.
https://jsonform.github.io/jsonform/playground/index.html
MIT License
2.72k stars 553 forks source link

date / datetime formatting #447

Open clach04 opened 3 months ago

clach04 commented 3 months ago

With:

{
    "value": {
        "datetime": "2000-01-01 00:00:00", 
        "date": "2000-01-01"
    }, 
    "form": [
        {
            "type": "date", 
            "key": "date"
        }, 
        {
            "type": "datetime-local", 
            "key": "datetime"
        }
    ], 
    "schema": {
        "datetime": {
            "type": "string", 
            "title": "datetime"
        }, 
        "date": {
            "type": "string", 
            "title": "date"
        }
    }
}

in Playground https://jsonform.github.io/jsonform/playground/index.html I'm seeing US date format in the form, not the ISO/ANSI format in the json. On submission it is correct but on screen it's not. Is there any control over this?

sdetweil commented 3 months ago

I do not see anything in particular about iso, but this about html5 field types

Screenshot_20240128_191743_Chrome

sdetweil commented 3 months ago

also Screenshot_20240128_192433_Chrome

clach04 commented 3 months ago

Yes, those are the type I'm using. I scanned the js code briefly and couldn't see how it worked, it was like magic! I wondered if this was a bootstrap (v3) thing?