Posts

Showing posts with the label Datepicker

Bootstrap 4 Datepicker

Answer : You can too override default datepicker classes like the following: the default bootstrap font size is 1rem or 16px so update .datepicker class font-size: 0.875em; or/and update the cell width and height: .datepicker td, .datepicker th { width: 1.5em; height: 1.5em; } <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.min.css" rel="stylesheet"/> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"></head> <body> <main class="cont...

Changing The String Format Of The WPF DatePicker

Answer : I have solved this problem with a help of this code. Hope it will help you all as well. <Style TargetType="{x:Type DatePickerTextBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <TextBox x:Name="PART_TextBox" Text="{Binding Path=SelectedDate, StringFormat='dd MMM yyyy', RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> It appears, as per Wonko's answer, that you cannot specify the Date format in Xaml format or by inheriting from the DatePicker. I have put the following code into my View's constructor which overrides the ShortDateFormat for the current thread: CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy"; Thread.CurrentThread.CurrentCu...

Android Material Design Inline Datepicker Issue

Answer : The calendarViewShown attribute is deprecated in the calendar-style date picker. If you want the spinner-style date picker back, you can set the datePickerMode attribute to spinner . <DatePicker ... android:datePickerMode="spinner" /> As for the scrolling issue, the calendar-style date picker doesn't support nested scrolling.

Are There Any Style Options For The HTML5 Date Picker?

Image
Answer : The following eight pseudo-elements are made available by WebKit for customizing a date input’s textbox: ::-webkit-datetime-edit ::-webkit-datetime-edit-fields-wrapper ::-webkit-datetime-edit-text ::-webkit-datetime-edit-month-field ::-webkit-datetime-edit-day-field ::-webkit-datetime-edit-year-field ::-webkit-inner-spin-button ::-webkit-calendar-picker-indicator So if you thought the date input could use more spacing and a ridiculous color scheme you could add the following: ::-webkit-datetime-edit { padding: 1em; } ::-webkit-datetime-edit-fields-wrapper { background: silver; } ::-webkit-datetime-edit-text { color: red; padding: 0 0.3em; } ::-webkit-datetime-edit-month-field { color: blue; } ::-webkit-datetime-edit-day-field { color: green; } ::-webkit-datetime-edit-year-field { color: purple; } ::-webkit-inner-spin-button { display: none; } ::-webkit-calendar-picker-indicator { background: orange; } <input type="date"> Currently, there is no...