Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

Flex Date Utils
Project Home Blog Forums Known Issues External Project Link Contact Project

Flex Date Utils Issue: DataDiff, - invalid months returned

Name: DataDiff, - invalid months returned
ID: 5
Project: Flex Date Utils
Type: Bug
Area: Code
Severity: Normal
Status: Fixed
Related URL:
Creator: Adam Adamczyk
Created: 01/09/10 9:50 AM
Updated: 01/20/10 12:30 AM
Description: Wrong number of months returned for example below

code:
var startDate : Date = new Date;

var endDate : Date = DateUtils.dateAdd(DateUtils.YEAR, 1, startDate);
endDate = DateUtils.dateAdd(DateUtils.DAY_OF_MONTH, -1 , endDate);

var months : int = DateUtils.dateDiff(DateUtils.MONTH, startDate, endDate);

trace(" months : " + months.toString());
--
it returns -1 instead of 11.
History: Created by herbat (Adam Adamczyk) : 01/09/10 9:50 AM

Updated by Lampei (Gareth Arch) : 01/20/10 12:30 AM
Added code fix and uploaded to source. Thanks Adam.

To add a comment to this bug, please login using the link above.