java - Date split - algorithm -
i have few date ranges have split there no overlapping sets. in below table, record 0 has split 2 (0-1/01/2014-1/11/2014), (0-1/12/2014-1/12/2014) differentiate first range range not overlapping other ranges , and second range overlapping record# 1 range.
table1 record# start date end date 0 1/05/2014 1/12/2014 1 1/12/2014 1/23/2014 2 1/14/2014 1/16/2014 result table need this... table2 record startdate enddate 0 1/05/2014 1/11/2014 0 1/12/2014 1/12/2014 1 1/12/2014 1/12/2014 1 1/13/2014 1/13/2014 1 1/14/2014 1/16/2014 2 1/14/2014 1/16/2014 1 1/17/2014 1/23/2014
i have followed approach below, didn't give me desired results.
prepare list: (1/05/2014, 1/12/2014, 1/14/2014, 1/16/2014, 1/23/2014) prepare interval list: (1/05/2014, 1/11/2014), (1/12/2014, 1/13/2014), (1/14/2014, 1/15/2014), (1/16/2014, 1/23/2014)
Comments
Post a Comment