且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从用户那里获取日期/时间输入的***方法是什么?

更新时间:2023-11-27 08:32:16

给我一​​个日历,用鼠标选择日期.让我用键盘输入日期.接受尽可能多的格式.如果我需要输入2012年12月21日,请允许我使用:

Give me a calendar to select the date with a mouse. And let me type the date in with the keyboard. Accept as many formats as possible. If I need to enter December 21, 2012, let me use:

  • 2012年12月21日
  • 2012年12月21日
  • 2012年12月21日
  • 2012年12月21日(或2012年12月21日,选择一个,也许取决于我在哪个国家/地区使用该软件)
  • 12212012(与上面的括号相同)
  • 等等.

无论您决定采取什么措施来解决本地化问题,都要确保显而易见.给我一个例子,或一个可以键入的带有MMDDYYYY的模板.

Whatever you decide to do to solve the localization issue, make sure it's obvious what you expect. Give me an example, or a template with MMDDYYYY that I can type over.

请不要在需要滚动的地方给我下拉框,尤其是多年的滚动框.如果我年纪大了并且正在进入DOB,那么我一生中没有足够的时间向下滚动到下拉框的底部.当我不知道选项是什么时,下拉框是一个很好的模式,但是如果我非常熟悉该选项(例如我的生日),则下拉菜单会很麻烦.

Please don't give me pull-down boxes where I have to scroll, especially through years. If I'm old, and I'm entering my DOB, I don't have enough time left in my life to scroll down to the bottom of your pull-down box. Pull-down boxes are a good pattern to use when I don't know what the options are, but if it's something I'm very familiar with, like my birth date, then pull-down menus are a hassle.

现在,WRT时间输入(很大的烦恼),不要以为我是凌晨3点.如果我输入的时间是3,则假设我的意思是下午3点.让我做额外的工作来安排凌晨3点.如果您不愿意为我承担这么多的费用,请至少提醒我我计划在凌晨3点安排一些事情,这样我现在就可以解决问题,而不是稍后在我的活动邀请列表中的某人发送电子邮件时说:您该死,将我们的D& D聚会安排在凌晨3点!"

Now, WRT time inputs (Big pet peeve), don't assume that I meant 3 am. If I enter 3 for the time, assume I meant 3 pm. Make me do extra work to schedule something at 3 am. If you're uncomfortable with assuming that much on my behalf, at least alert me that I've scheduled something for 3 am so I can fix it now instead of later when someone on my event invitation list emails and says "You moron, you scheduled our D&D Meetup for 3 am!"