question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Styling Possibilities for Datepicker Field

See original GitHub issue

Question

Hi,

we have recently implemented the datetimepicker module and we like it a lot. One thing we are now facing is the challenge to somehow style the component that shows the date.

Bildschirmfoto 2020-11-24 um 15 50 09

We would like to style it as all our input fields ( border, backgroundColor, fontColor and even enrich it with a calendar icon )

Is there any way to use a custom component ( like a textLink, an styled inputfield or anything ) to show the Calendar or can it only be triggered by using the

<DateTimePicker
          testID="dateTimePicker"
          value={date}
          mode={mode}
          is24Hour={true}
          display="default"
          onChange={onChange}
        />

A very simple example would help i guess.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ravirajn22commented, Dec 2, 2020

Use display: 'inline' for iOS this will show the picker directly on screen, now design your input fields the way you want, then onPress show this DateTimePicker in a modal or whatever way you want.

0reactions
vonovakcommented, Nov 26, 2022

Hello and thanks for asking, to the best of my knowledge, changing the styles of the provided compact picker is not possible, the native component does not offer much styling possibilities. You’ll have to resort to workarounds. Thank you 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are there any style options for the HTML5 Date picker?
On some platforms, the datepicker looks extremely different and I personally can't think of any generic way of styling the native datepicker. Save...
Read more >
Styling a native date input into a custom, no-library datepicker
For Helppo users, I wanted to offer a way to edit date and datetime values more conveniently than with a plain text input....
Read more >
Options — bootstrap-datepicker documentation - Read the Docs
All options that take a “Date” can handle a Date object; a String formatted ... If false the datepicker will not show on...
Read more >
Style options for the HTML5 Date picker - Tutorialspoint
The date picker in HTML5 basically works very similar to how the JavaScript Libraries did, when we focus on the field a calendar...
Read more >
Datepicker Widget - jQuery UI API Documentation
A function that takes an input field and current datepicker instance and returns an options object to update the datepicker with.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found