Delphi:我可以扩展TDateTimePicker来支持另一个日历系统吗?怎么样?

时间:2015-02-17 04:54:41

标签: delphi datepicker calendar persian

我想将日历系统(如公历)实现为TDateTimePicker。

1)我想知道我可以扩展TDateTimePicker类以使用其可视功能,但更改其日历计算系统以匹配我的日历系统吗?

2)如果是,那么我必须做什么?必须更改或扩展哪些类以改变其计算系统?起点是什么?

2 个答案:

答案 0 :(得分:3)

TDateTimePicker只是微软DTP control的一个薄薄的包装器。它不支持更改基础日历系统。

About Date and Time Picker Controls

  

该控件基于公历,该公式于1753年推出。它不会计算与儒略历的一致日期。

答案 1 :(得分:2)

这里是波斯日期选择器:

https://github.com/A1Gard/PDate

enter image description here

关于这个:

The best Delphi & lazarus unit for convert windows standard DateTime to PersianDate & TimeStamp
version 1.3.1:

some bug fixed
version 1.3:

added lazarus compatibility
added function GetTheFirstDayOfThisMonth
added function GetTheFirstDayOfThisWeek
added function GetPersianDayWeek
added function Delphi DatePicker component
fixed bug in PersiantoGer function
version 1.2:

added function DateTimeToUnix
added function UnixToDateTime
version 1.1:

added function UIntToDateTime
added function GerToWord
added function PersianToInt
version 1:

added function GerToPersian
added function PersiantoGer 

Author persian descrption