Skip to content

Commit ffef1da

Browse files
Update time save format in MaterialTimeControl
1 parent 0c515e7 commit ffef1da

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/examples/src/control-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const data = {
102102
number: 50.5,
103103
integer: 50,
104104
date: '2020-06-25',
105-
time: '23:08',
105+
time: '23:08:00',
106106
dateTime: '2020-06-25T23:08:42+02:00',
107107
enum: 'Two'
108108
};

packages/material/src/controls/MaterialTimeControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class MaterialTimeControl extends Control<
7171
);
7272

7373
const format = appliedUiSchemaOptions.timeFormat ?? 'HH:mm';
74-
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? 'HH:mm';
74+
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? 'HH:mm:ss';
7575

7676
const firstFormHelperText = showDescription
7777
? description

packages/material/test/renderers/MaterialTimeControl.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { initCore, TestEmitter } from './util';
4040

4141
Enzyme.configure({ adapter: new Adapter() });
4242

43-
const data = { foo: '13:37' };
43+
const data = { foo: '13:37:05' };
4444
const schema = {
4545
type: 'object',
4646
properties: {
@@ -203,7 +203,7 @@ describe('Material time control', () => {
203203
);
204204
const input = wrapper.find('input').first();
205205
input.simulate('change', { target: { value: '08:40' } });
206-
expect(onChangeData.data.foo).toBe('08:40');
206+
expect(onChangeData.data.foo).toBe('08:40:00');
207207
});
208208

209209
it('should update via action', () => {
@@ -213,7 +213,7 @@ describe('Material time control', () => {
213213
<MaterialTimeControl schema={schema} uischema={uischema} />
214214
</JsonFormsStateProvider>
215215
);
216-
core.data = { ...core.data, foo: '08:40' };
216+
core.data = { ...core.data, foo: '08:40:00' };
217217
wrapper.setProps({ initState: { renderers: materialRenderers, core }} );
218218
wrapper.update();
219219
const input = wrapper.find('input').first();

0 commit comments

Comments
 (0)