hamzahamidi / ajsf

Angular JSON Schema Form
https://hamzahamidi.github.io/ajsf
MIT License
363 stars 184 forks source link

Values extracted from date-time components cannot be entered back into date-time components #229

Open benrebak opened 4 years ago

benrebak commented 4 years ago

Describe the bug which template:

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

1.

<div>
  <json-schema-form
                    loadExternalAssets="true"
                    framework="bootstrap-4"
                    [schema]="mySchema"
                    [data]="myData">
  </json-schema-form>
</div>

2.


  mySchema = {
    schema: {
      title: 'Date and time widgets',
      type: 'object',
      properties: {
        native: {
          title: 'Native',
          description: 'May not work on some browsers, notably Firefox Desktop and IE.',
          type: 'object',
          properties: {
            datetime: { type: 'string', format: 'date-time' },
            date: { type: 'string', format: 'date' }
          }
        }
      }
    }
  };

  myData = {
    native: {
      datetime: '2020-08-26T09:59',
      date: '2020-08-26'
    }
  };

Expected behavior

Form initialises with date-time component set to 2020-08-26T09:59:00Z, date-time component renders properly

Actual behavior

image

image

Desktop (please complete the following information):

Context

If loading data into a form, you should be able to see the date-time values previously entered.

benrebak commented 4 years ago

Anyone?

github-actions[bot] commented 4 years ago

Stale issue

SeekSwift commented 6 months ago

I also encountered this. I even tried a workaround to change the datetime values inside the supplied json to the format specified, which works until the user enters something, upon which all the datetime fields get emptied and the warning pops up again. I know this issue is super old but did you find any fix or work around by chance @benrebak ?