[ 
https://issues.apache.org/jira/browse/FLEX-13423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13678955#comment-13678955
 ] 

Justin Mclean commented on FLEX-13423:
--------------------------------------

Unable to reproduce in develop branch. Can you describe the steps to reproduce 
it with this code?


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx">
        
        <s:layout>
                <s:VerticalLayout />
        </s:layout>
        
        <fx:Script>
                <![CDATA[
                        import mx.events.CalendarLayoutChangeEvent;
                        
                        protected function 
changed(event:CalendarLayoutChangeEvent):void
                        {
                                var length:int = dc.selectedRanges.length;
                                var selected:String = "";
                                
                                for (var i:int; i < length; i++) {
                                        selected += " " + 
dc.selectedRanges[i].rangeStart + " - " + dc.selectedRanges[i].rangeEnd;
                                }
                                
                                l.text = selected;
                        }
                        
                ]]>
        </fx:Script>
        <mx:DateChooser id="dc" change="changed(event)" 
allowMultipleSelection="true" />
        
        <s:Label id="l" />
        
</s:Application>

As far a sI can see removeRangeFromSelection doesn't contain code above.

    mx_internal function removeRangeFromSelection(startDate:Date, 
endDate:Date):void
        {
                var rangeEnd:Date;
                var rangeStart:Date;
                
                if (endDate < startDate)
                        return;
                
                for (var n:int = 0; n < selectedRangeCount; n++)
                {
                        rangeStart = _selectedRanges[n].rangeStart;
                        rangeEnd = _selectedRanges[n].rangeEnd;
                        
                        // ignore selection range outsie of date range
                        if (endDate < rangeStart || startDate > rangeEnd)
                                continue;
                        
                        // remove selection range inside of date range
                        if (startDate <= rangeStart && endDate >= rangeEnd)
                        {
                                _selectedRanges[n] = null;
                        }
                        // split selection range if date range inside selection 
range
                        else if (startDate > rangeStart && endDate < rangeEnd)
                        {
                                var temp:Date = _selectedRanges[n].rangeEnd;
                                
                                _selectedRanges[n].rangeEnd = 
addSubtractDays(startDate, -1);
                                
                                _selectedRanges[selectedRangeCount] = {};
                                _selectedRanges[selectedRangeCount].rangeStart 
= addSubtractDays(endDate, +1);
                                _selectedRanges[selectedRangeCount].rangeEnd = 
temp;
                                
                                selectedRangeCount++;
                        }
                        // move selection start date if end overlaps
                        else if (endDate >= rangeStart)
                        {
                                _selectedRanges[n].rangeStart = 
addSubtractDays(endDate, +1);   
                        }
                        // move selection end date if start overlaps
                        else if (startDate <= rangeEnd)
                        {
                                _selectedRanges[n].rangeEnd = 
addSubtractDays(startDate, -1);   
                        }                       
                }
                
                // clean up any removed selections
                for (n = selectedRangeCount -1; n > 0; n--)
                {
                        if (_selectedRanges[n] == null)
                        {
                                _selectedRanges.splice(n,1);
                                selectedRangeCount--;
                        }
                }
        }

                
> DateChooser selectedRanges gives selectedRange start+1 day [if 
> selectedRanges.rangeStart is same as selectableRange.rangeStart]
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-13423
>                 URL: https://issues.apache.org/jira/browse/FLEX-13423
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DateChooser
>    Affects Versions: Adobe Flex SDK Previous
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Language Found: English
>            Reporter: Adobe JIRA
>            Assignee: Justin Mclean
>            Priority: Minor
>              Labels: easyfix, easytest
>             Fix For: Apache Flex 4.10.0
>
>
>       Steps to reproduce:
> 1. Compile and run the below sample piece of code
> <?xml version="1.0" encoding="iso-8859-1"?> 
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
>       <mx:DateChooser id="dc" selectableRange="{{rangeStart: new 
> Date(2007,11,11), rangeEnd: new Date(2007,11,19)}}" 
> allowMultipleSelection="true" />
>       <mx:Button label="Selected Range" click="run()"/>
>       <mx:Script>
>                       <![CDATA[
>                               public function run():void{
>                                       for(var 
> i:int=0;i<dc.selectedRanges.length;i++)
>                                               {
>                                                       
> trace(dc.selectedRanges[i].rangeStart);
>                                                       
> trace(dc.selectedRanges[i].rangeEnd);
>                                               }
>                                       }
>                                       ]]
>       >
>               </mx:Script>
> </mx:Application>
> 2. Notice that selectable range is in between 11-December to 19-December
> 3. Select all the dates 
> 4. Click on the button 'Selected Range'. Notice that in the trace selected 
> range start shows 12-December.
>  Actual Results: DateChooser selectedRanges gives selectedRange start+1 day.
>  
>  
>  Expected Results: selectedRange start date should be 11-December.
>  
>  
>  Workaround (if any): none
>     

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to