react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

Allow customization of 'Now' and 'Clear' buttons in alt-date widget

Open amiuhle opened this issue 6 years ago • 11 comments

Reasons for making this change

The Now and Clear buttons on the alt-date widget are static. This adds support for customization via ui:options.

Checklist

  • [x] I'm updating documentation
    • [x] I've checked the rendering of the Markdown text I've added
  • [x] I'm adding or updating code
    • [x] I've added and/or updated tests
    • [x] I've updated docs if needed
    • [x] I've run npm run cs-format on my branch to conform my code to prettier coding style
  • [x] I'm adding a new feature
    • [x] I've updated the playground with an example use of the feature

amiuhle avatar May 23 '18 22:05 amiuhle

I'll update the docs and add a playground example, just wanted to make sure this gets merged / is the right approach first.

amiuhle avatar May 23 '18 22:05 amiuhle

I also added the possibility to edit the placeholders for the dropdowns.

amiuhle avatar May 24 '18 21:05 amiuhle

The code seems OK, but I guess I would bikeshed the names of the options. How about options.placeholders.year or options.yearPlaceholder instead of options.year?

glasserc avatar May 27 '18 18:05 glasserc

I can do that, I'd prefer the namespaced options.placeholders.year option. How about the "Now" and "Clear" buttons? options.labels?

amiuhle avatar May 28 '18 01:05 amiuhle

I will try and remember to update my TimeWidget and AltTimeWidget MRs to support this once we agree on the naming convention.

r4j4h avatar Jun 25 '18 18:06 r4j4h

@amiuhle -- are you still working on this? If so, could you update the names of the options and also add some tests? I like options.placeholders and options.labels as you suggested.

epicfaace avatar Jan 19 '19 19:01 epicfaace

Is there an example for this? Or can you say what should be the code.

swetapatnaik avatar Jan 25 '19 13:01 swetapatnaik

@epicfaace Totally forgot about this, I'll have a look next week.

amiuhle avatar Jan 25 '19 14:01 amiuhle

@amiuhle just bumping this!

epicfaace avatar Mar 27 '19 13:03 epicfaace

@epicfaace I put the placeholders / labels into namespaces, added docs and a placeholder example and added some tests.

amiuhle avatar Dec 10 '19 16:12 amiuhle

Any chance this can be merged?

amiuhle avatar Jan 21 '21 10:01 amiuhle

Closing in favor of #3460

heath-freenome avatar Feb 27 '23 19:02 heath-freenome