Need to show only Weekday with Date UIDatePicker in iPhone


Need to show only Weekday with Date UIDatePicker in iPhone



Is there any way to show only week day with Date as: MON 03-JUL in UIDatePicker in iPhone.

Please help.




How to show “Done” button on iPhone number pad

1:



How do you duplicate a file in XCode?
No, as far as I know there is no way to set a custom date format in UIDatePicker.


Unit testing an iPhone static library with XCode 3
Anyways, it wouldn't make much sense to display only the weekdays in a date picker, because you would end up with multiple entries for each weekday:.
Image getting pixelated when used as part of an animation in iPhone animation
  • Fri (3rd)
  • Sat (4th)
  • Sun (5th)
  • ...
  • Fri (10th)
  • Sat (11th)
  • ...
If you only want the user to pick a weekday (Mon-Sun), you could simply use a UIPickerView.


UITableView Animation Headache
And make sure you don't hard-code the weekday names, but rather use - (NSArray *)weekdaySymbols on NSDateFormatter.


iPhone OpenGL ES incorrect alpha blending
This will take the user's locale into account and returns an array of weekday names as strings:.
Does a NSURLConnection retain its delegate?
NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; NSArray* weekdays = [dateFormatter weekdaySymbols]; // will return Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday (en_US locale) 
Alternatively you can use shortWeekdaySymbols:.
Which button was tapped… iPhone and Obj-C question
NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; NSArray* weekdays = [dateFormatter shortWeekdaySymbols]; // will return Sun,Mon,Tue,Wed,Thu,Fri,Sat (en_US locale) 



56 out of 100 based on 61 user ratings 736 reviews