Fuzzy Date Time Picker Control in C# .NET?

后端 未结 4 1058
故里飘歌
故里飘歌 2020-12-05 06:01

I am implementing a Fuzzy Date control in C# for a winforms application. The Fuzzy Date should be able to take fuzzy values like

  • Last June
  • 2 Hours ago
4条回答
  •  感情败类
    2020-12-05 06:33

    We have a similar control. We just add a list of combo boxes - controls to pick your choice.

    PeriodSelector:

    • From [datepicker] Until [datepicker]
    • [numericupdown] months ago
    • [numericupdown] hours ago
    • Last week
    • Yesterday
    • Week [datepicker]
    • Day [datepicker]
    • ...

    And just take the choices that make sense for your purpose.

    It's a lot easier to implement this then parsing the text. The calculations are rather straightforward.

    It's important to see that you are picking a period. Last year means from january 2008 > december 2008. Two hours ago from now untill now - 2 hours. Etc.

提交回复
热议问题