日期选择器,它将动态接受日期 [英] date picker which will accepts the date dynamically

查看:79
本文介绍了日期选择器,它将动态接受日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以提供日期选择器,该选择器将动态更改日期格式,这意味着当我给出dd/mm/yyyy时它必须可以工作,如果我给出mm/dd/yyyy格式则它必须以这种格式显示

can any one provide a date picker which will change the date format dynamically means when i give dd/mm/yyyy it must work and if i give mm/dd/yyyy format it must display in this format

推荐答案

我给dd/mm/yyyy必须有效,如果我给mm/dd/yyyy格式必须以这种格式显示
一次只能定义一种格式.

让我告诉你原因.这是合乎逻辑的:
天数可以在1到12之间,月份也可以在1到12之间.如果您未定义格式,并且期望代码或控件根据日期由itslef假定格式,则对于诸如02/03/2010、08/03/2010、04/04/2010之类的日期会感到困惑等

希望你明白了.因此,您需要从前修复日历的格式.如果需要,可以在配置文件中定义格式,并且可以在运行时由日历选择格式.
i give dd/mm/yyyy it must work and if i give mm/dd/yyyy format it must display in this format
You can have only one format defined at one time.

Let me tell you the reason why. It''s a logical one:
Days can be between 1-12 and Months too can be between 1-12. If you don''t define the format and expect the code or control to assume the format by itslef based on the date then it wil get confused for dates like 02/03/2010, 08/03/2010, 04/04/2010, etc

Hope you got it. Thus, you need to fix the format of calenar from before. If needed, format can be defined in a config file and it can be picked by calendar at runtime.


您希望它如何实现?

如果您给的日期是12/07/2011,是否应该假设是12月7日?还是7月12日?
How do you expect it to do that?

If you give it 12/07/2011 should it assume that is December the 7th? or July the 12th?


请尝试以下链接:
日期选择器

如果我误解了您的问题,请随时纠正我.希望以上信息对您有所帮助.如果您还有其他顾虑,请告诉我.

如果这对您真的很有帮助,请不要忘记投票并接受答案.
Please try the following link:
Datepicker

If i misunderstand your question, please feel free to correct me.I hope the above information will be helpful. If you have more concerns, please let me know.

If this would be really helpful to you then don''t forgot to Vote and Make Answer as Accepted.


这篇关于日期选择器,它将动态接受日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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