title: How to customize the DatePickerDialog to show custom date in the text? - Swift
body: <p>I am trying to change the date written inside the datePickerDialog to make Hijri Islamic date. </p>
  
  <p>I found the function of showing the Hijri date as NSDateComponents</p>
  
  <pre><code>func hijriDate(dateToConvert: NSDate) -&gt; NSDateComponents{
          let islamic = NSCalendar(identifier:NSCalendarIdentifierIslamicCivil)!
          let hijriComponents = islamic.components(NSCalendarUnit(rawValue: UInt.max), fromDate: dateToConvert)
          print("Date in system calendar:\(dateToConvert), in Hijri:\(hijriComponents.year)-\(hijriComponents.month)-\(hijriComponents.day)")
          return hijriComponents
          //"Date in system calendar:2014-09-25 09:53:00 +0000, in Hijri:1435-11-30"
  }
  </code></pre>
  
  <p>So when the datePicker will print the date i wanna show the islamic component by converting the NSDate to Hijri Components.</p>
  
  <p>So is there any way to show custom text for the datePickerDialog ? So I can use the function above to print out the date as Hijri from the NSDate ?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The current <a href="https://github.com/squimer/DatePickerDialog-iOS-Swift" rel="nofollow">DatePickerDialog</a> I use is this:</p>
  
  <pre><code>let STR_DATE_FORMAT = "EEEE d, MMM yyyy"
  
  DatePickerDialog().show("Select date".localized(), doneButtonTitle: "OK".localized(), cancelButtonTitle: "Cancel".localized(), datePickerMode: .Date, defaultDate:self.data.event_date ) {
                  (date) -&gt; Void in
                  self.data.event_date = date
                  self.event_date.text = date.toString(format: .Custom(STR_DATE_FORMAT)) as String
  }
  </code></pre>