Date Picker Jumps back after change

Hi, I have a page with a sfdataform with different controls including a date picker. This date picker defaults to a value of one month and one year less than the actual date, and then when I try to change the date while running the app, the control jumps back to the greyed out date.

I have attached a screenshot of the default greyed out date. Could someone please advise me on the matter.

Kind Regards

Attachment: IMG_0001.PNG_7bf251a7.zip

4 Replies

RS Rikard Schouwstra September 17, 2018 07:34 AM UTC

This happens on iOS, but on Android it works perfectly. And I did set the minimum date as today. 


JN Jayaleshwari N Syncfusion Team September 17, 2018 11:19 AM UTC

Hi Rikard,  
  
Thank you for contacting Syncfusion support.  
   
We have analyzed your query with date picker editor in SfDataForm. We are not able to reproduce the mentioned issue from our side (date picker defaults to a value of one month and one year less than the actual date and when date in changed, the control jumps back to the greyed-out date).   
  
We have prepared a sample with date picker setting minimum date as today using SfDataForm. Kindly find the sample below,  
  
  
We have also attached the output video of the sample for iOS, please find the video from the below link,  
  
Video:  DataForm-video  
 
Code snippet:  
 
    dataForm.DataObject = new ContactInfo();  
    dataForm.RegisterEditor("DatePicker", new CustomDatePicker(dataForm));  
    dataForm.RegisterEditor("Date", "DatePicker");  
  
    public class ContactInfo  
     
        public string Name  
         
            get 
            set 
         
        private DateTime date;  
        [DataType(DataType.Date)]  
        public DateTime Date  
         
            get { return date; }  
            set { date = value; }  
         
     
  
    public class CustomDatePicker : DataFormEditor<DatePicker>  
     
        public CustomDatePicker(SfDataForm dataForm):base(dataForm)  
         
  
         
  
        protected override DatePicker OnCreateEditorView()  
         
            DatePicker datePicker = new DatePicker();  
            datePicker.Format =  "yyyy/MM/d" 
            datePicker.MinimumDate = DateTime.Now.Date;  
            return datePicker;  
        }            
        protected override void OnInitializeView(DataFormItem dataFormItem, DatePicker view)  
         
            base.OnInitializeView(dataFormItem, view);  
         
     
  
Could you please check with the provided sample and if further issue reproduced kindly revert us back by modifying the provided sample along with below details,  
  
  • DataForm version used 
  • iOS device configuration 
  
So that it will be helpful for us to analyze and provide you better solution.  
 
Regards, 
Jayaleshwari N. 



RS Rikard Schouwstra September 19, 2018 01:00 PM UTC

Thank you very much, in some of my pages this works perfectly. In other pages it still occurs, even when I do not set a minimum date.  It shows correct in the dataform, but then when the date picker is open, the two dates differ. I've attached another screenshot of this occurring.  I am using an iPhone X iOS 12.0 Simulator, and SfDataForm version 16.1.0.37.

Regards

Attachment: Screen_Shot_20180919_at_14.59.36_465a0f0c.zip


JN Jayaleshwari N Syncfusion Team September 21, 2018 12:22 PM UTC

Hi Rikard,  
  
In some of my pages this works perfectly. In other pages it still occurs:  
  
We have checked the mentioned scenario in iPhone X iOS 12.0 Simulator, and SfDataForm version 16.1.0.37 and we are not able to reproduce the issue from our side.  
  
# Setting today’s date as minimum date in DatePicker  
# Default date value differs in display field and in DatePicker.  
  
Could you please share the code snippet or the sample in which issue occurs along with the replication procedure (mentioned by you)? Such that it will be helpful for us to analyze and provide you possible solution. However, could you please check the same in our latest SfDataForm version 16.2.0.50 at your end and revert us back if issue still reproduced.  
 
Regards, 
Jayaleshwari N 


Loader.
Up arrow icon