datepicker

React Antd DatePicker with custom format for input and for display

百般思念 提交于 2021-02-11 15:29:55
问题 I am currently using DatePicker Component of antd for displaying date but not able to customize the input format and display format. Eg: user would type the date as mmddyy (112119) format, datePicker should display date as 2019-11-21. Please find the sandbox link which I have tried by setting the value to datePicker but its getting overridden by format attribute https://codesandbox.io/s/wonderful-star-75qjq 回答1: Inspect the onOpenChange event and change the format prop can do this. class

Jquery ui datepicker preselect date that is not a sunday

帅比萌擦擦* 提交于 2021-02-11 15:11:38
问题 I have modified the jquery ui datepicker to pre-select the day that is 2 days from now and I have also disabled Sundays in the datepicker. However, the input field is still being pre-filled with the Sunday if the Sunday is 2 days from now. How do I prevent this? $(function() { $("#delivery-date").datepicker({ minDate: +2, maxDate: '+2M', dateFormat: "DD, d MM yy", showOn: "both", buttonText: "Change", beforeShowDay: function(date) { var day = date.getDay(); return [(day != 0), '']; } })

Find the number of sunday between two dates and if sunday comes between two dates then substract the sunday

£可爱£侵袭症+ 提交于 2021-02-11 12:23:05
问题 In this JavaScript I am able to calculate the difference two dates but am not able to find the Sunday between dates. If Sunday occurs between two dates then subtract the Sunday from the dates and display the total number of days. $(function () { $(".datepicker").datepicker({ dateFormat: 'dd M y'}); $(".datepicker_2").datepicker({ dateFormat: 'dd M y'}); $('.datepicker').change(function () { var start = $.datepicker.parseDate('dd M y', $(".datepicker").val()); var end = $.datepicker.parseDate(

Disable few date ranges in Bootstrap-datepicker

点点圈 提交于 2021-02-11 07:44:25
问题 I'm trying to disable few date range arrays using BeforeShowDay fucntion in Bootstrap-Datepicker. I have such code: var dateArray2 = getDates(new Date("2016-12-20 14:57:28"), (new Date("2016-12-22 14:57:28")).addDays(0)); var dateArray3 = getDates(new Date("2016-12-22 14:57:28"), (new Date("2016-12-25 14:57:28")).addDays(0)); var dateArr = new Array(); dateArr.push(dateArray2); dateArr.push(dateArray3); //Datepicker init $('.date').datepicker({ format: 'dd-mm-yyyy', startDate: date, autoclose

react-datepicker years range

匆匆过客 提交于 2021-02-10 22:43:37
问题 I am using the react-datepicker package.https://reactdatepicker.com/ I am trying to create a custom date picker with a years range, following their example but I can not make the range work. I am not even sure if I am importing that range from the right place tbh. My code: import DatePicker, {getYear, getMonth, range} from 'react-datepicker'; import "react-datepicker/dist/react-datepicker.css"; const Foo = () => { const [startDate, setStartDate] = useState(new Date()); const years = range

Angular Material Datepicker design issue when opening calendar

感情迁移 提交于 2021-02-10 18:34:30
问题 I am having an issue when using Angular Material Datepicker and I can't seem to find the root problem of it. I couldn't think of a way to word this question. Whenever I open the calendar and I'm selecting the day, the overlay is too large and is past the boundaries of the box. Hopefully, this attached image can help: I have the following imports in the module the component is in: import { MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule, MatOptionModule } from '

WPF 4 - DatePicker - How to set DisplayMode to Decade?

為{幸葍}努か 提交于 2021-02-10 16:47:16
问题 This code makes the background of the calendar orange, but it does not default the DisplayMode to Decade. Does anybody know why? What can I do to default it to "Decade"? <DatePicker SelectedDate="{Binding TheDate}"> <DatePicker.CalendarStyle> <Style TargetType="Calendar"> <Setter Property="DisplayMode" Value="Decade"/> <Setter Property="Background" Value="Orange"/> </Style> </DatePicker.CalendarStyle> </DatePicker> 回答1: The DatePicker control sets CalendarMode to month explicitly when the

MaterialDatePicker is slow

吃可爱长大的小学妹 提交于 2021-02-10 14:41:09
问题 I'm using MaterialDatePicker, but it's slow. public class MainActivity extends AppCompatActivity { MaterialDatePicker.Builder<Long> datePickerBuilder; MaterialDatePicker<Long> datePicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); datePickerBuilder = MaterialDatePicker.Builder.datePicker(); datePicker = datePickerBuilder.build(); Button btn = findViewById(R.id.btn); btn.setOnClickListener(new View

MaterialDatePicker is slow

為{幸葍}努か 提交于 2021-02-10 14:40:33
问题 I'm using MaterialDatePicker, but it's slow. public class MainActivity extends AppCompatActivity { MaterialDatePicker.Builder<Long> datePickerBuilder; MaterialDatePicker<Long> datePicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); datePickerBuilder = MaterialDatePicker.Builder.datePicker(); datePicker = datePickerBuilder.build(); Button btn = findViewById(R.id.btn); btn.setOnClickListener(new View

angular material md-datepicker not working in an ionic modal

好久不见. 提交于 2021-02-10 12:03:37
问题 I am attempting to use an angular material md-datepicker within an ionic modal and am not having the ng-change event being fired when the datepicker is used and date is changed,the datepicker itself won't scroll, and doesn't seem clickable. When I have tried using the datepicker outside of the modal, all works correctly. What is going on here? <script id="add-location-modal.html" type="text/ng-template"> <ion-modal-view> <ion-content> <md-content layout-padding> <form name="myForm" style="">