Dateevent from daterangepicker is shifted by one day before 12 AM

Hi,
I've found a strange bug in my timezone (probably in other time zones too) GMT + 02:00 .
onDataRangeChange gives datevents which are shifted by one day foreward but only before 12 AM.
e.g. you pick 12.02.2018 and get 13.02.2018. 
Also before 12 AM the initialized startDate and endDate are shifted.
Please help me with this.
Thanks

3 Replies

PK Prem Kumar Madhan Raj Syncfusion Team July 20, 2018 11:42 AM UTC

Hi Sarah,   
  
Thanks for contacting Syncfusion Support.   
  
We have checked with the reported issue and cannot reproduce the issue at our end. So, kindly revert with the below mentioned information, so that we can reproduce this issue at our end and provide a solution to resolve this.   
 
  1. System TimeZone (Time zone used in your local machine)
  2. As you mentioned the value before 12:00 AM, mention any specific time range within which the issue occurs.
  3. Browser in which the issue occur.
  4. Packages version used in your application.
  5. Initialization code block for DateRangePicker/ any simple sample for reproducing issue.
  6. Culture in which DateRangePicker is rendered (if other than English culture).
  
Regards,   
  
Prem Kumar M


SR Sarah Riethmüller July 21, 2018 01:31 PM UTC

Hi,
here is the additional info for you:

1. UTC +01:00 Berlin
2. error occurs between 12 PM and 12 AM
3. Chrome
4. 16.2.41

declare let require: Function;
loadCldr(
require('../../../../node_modules/cldr-data/main/de/ca-gregorian.json'),
require('../../../../node_modules/cldr-data/main/de/numbers.json'),
require('../../../../node_modules/cldr-data/main/de/timeZoneNames.json')
);

ngOnInit() {
setCulture('de');
L10n.load({
'de': {
'daterangepicker': {
placeholder: 'Wählen Sie einen Bereich aus',
today: 'heute',
startLabel: 'Wählen Sie Startdatum',
endLabel: 'Wählen Sie Enddatum',
applyText: 'Bestätigen',
cancelText: 'Abbrechen',
selectedDays: 'Ausgewählte Tage',
days: 'Tage',
stomRange: 'benutzerdefinierten Bereich',
startDate: 'Anfangsdatum',
endDate: 'Enddatum'
}
},
'en': {
'daterangepicker': {
placeholder: 'Please select a range',
today: 'Today',
startLabel: 'Choose a start date',
endLabel: 'Choose an date',
applyText: 'Apply',
cancelText: 'Cancel',
selectedDays: 'Selected days',
days: 'Days',
stomRange: 'Stom range',
startDate: 'Start date',
endDate: 'End date'
}
}
});
}

6. german and I checked english too

Thanks



PK Prem Kumar Madhan Raj Syncfusion Team July 23, 2018 12:07 PM UTC

Hi Sarah,   
  
Thanks for the update.   
   
We have checked the issue based on shared information and suspect that the startDate and endDate values of the DateRangePicker component should have been assigned with the UTC string (along with time zone consideration) due to which the reported issue may occur. This is because, whenever a value in UTC with time zone consideration is processed at the client end, it will get converted based on the client time zone by adding the time zone offset value to the Date value which will result in change of Date values.    
   
In detail, if UTC value 2018-02-12T23:00:00.000Z (2/12/2018 11:00 PM) is processed at client end with zone of UTC+1, the offset value 1 hour will get added to the UTC date value and converts the value as 2/13/2018 for 1 hour added to 11 PM converts the value to next day. Similar case should have been happened in your application. If this is your case, then we request you to pass the date value to the startDate and endDate value by removing the zone factor in the UTC date value as shown below so that the time zone based conversion can be restricted.   
   
2018-02-12T23:00:00.000   instead of 2018-02-12T23:00:00.000Z   
  
If this is not your case, then please revert with the source code for DateRangePicker initialization and values being assigned to the control along with an issue reproducing sample, so that we can validate the issue at our end and provide an exact solution for your requirement.   
  
Regards,   
  
Prem Kumar M  


Loader.
Up arrow icon