如何验证ListOf(日期范围)内的日期范围以避免重叠 [英] How to Validate range of Date within ListOf (Range of Dates) to avoid overlap

查看:80
本文介绍了如何验证ListOf(日期范围)内的日期范围以避免重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决这个问题的最佳方法是什么?





例如现有的范围是

--- FromDate ----- ToDate

1)01-01-2012 - 31-01-2012

2)20-02-2012 - 28-02-2012

3)05-10-2011 - 30-11-2011



需要验证范围如

15-01-2012 - 30-07-2013 - 错误

01-02-2012 - 10-02-2012 - 右





在此先感谢...

what is best way to solve this ???


e.g. existing range is
---FromDate-----ToDate
1) 01-01-2012 - 31-01-2012
2) 20-02-2012 - 28-02-2012
3) 05-10-2011 - 30-11-2011

need to validate range like
15-01-2012 - 30-07-2013 - Wrong
01-02-2012 - 10-02-2012 - Right


Thanks In Advance...

推荐答案

这不是一项琐碎的任务好像是。



如果我是你,我会看一眼来自Jani Giannoudis的优秀文章/图书馆:

.NET时间段库 [ ^ ]
It's not as a trivial task as it seems to be.

If I were you, I would have a glance at the excellent article/library from Jani Giannoudis:
Time Period Library for .NET[^]


感谢Philo,它运行正常。 。



是否有用于数值范围重叠验证的库。
Thanks Philo, It works fine..

Is there any library for Numeric Range Overlap validation.


这篇关于如何验证ListOf(日期范围)内的日期范围以避免重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆