Export to GitHub

holly-gtk-widgets - HDateEditor.wiki


Introduction

This widget is a date time picker, supporting custom formatting options.

Details

http://lh5.ggpht.com/fr.daniil/SC2x63asyQI/AAAAAAAAABg/GgtQyuEU_Es/datetime-picker.jpg


Methods: | bool | IsDateValid() | - | returns true if the date-time string is valid | |:-------|:------------------|:--|:----------------------------------------------|

Properties: | DateTime | CurrentDate | gets/sets the current date-time | |:-----------|:----------------|:---------------------------------| | DateTimeFormatTypeEnum | DateTimeFormatType | gets/sets the current date-time format type | | Gdk.Color | ErrorColor | gets/sets the text color when format is invalid |

Events: |EventHandler| DateChanged | - raised when date-time value is changed | |:-------------|:----------------|:-----------------------------------------|


  • Formatting types:

    1. Custom
    2. FullDateTime
    3. ShortTime
    4. ShortDate
    5. LongDate
    6. LongTime
  • Custom format example: this.dateEditWidget.DateTimeFormatType = HollyLibrary.DateTimeFormatTypeEnum.Custom; this.dateEditWidget.CustomFormat = "dd/MM/yyyy 'and time is:' HH:mm:ss"; this.dateEditWidget.CurrentDate = DateTime.Now;

  • Simple short date-only format example: this.dateEditWidget.DateTimeFormatType = HollyLibrary.DateTimeFormatTypeEnum.ShortDate; this.dateEditWidget.CurrentDate = DateTime.Now;