I need to create a calendar with custom date formats like, "December 10 2010 " and place in a Picker.I know how to get the required date format but not able to generate calendar. Help me with good tutorials or suggestions.
I need to create a calendar with custom date formats like, "December 10 2010 " and place in a Picker.I know how to get the required date format but not able to generate calendar. Help me with good tutorials or suggestions.
You need to provide more information about what you want to do.
Do you want your app to localize to different country's date formats? Specific date formats have the disadvantage that they don't handle different "locales" very well (if at all). It's usually better to ask for a "date style" and let the system decide how to format it. That way, if your customer is in a European country, they'll get day month year, and if they are in the US, they'll get our (strange) month day year format.
Are you trying create a custom version of the UIDatePicker control? In the US, at least, a date picker has 3 wheels, where the left wheel is the month name, the the middle wheel is the day of the month, and the right wheel is the year. That sounds like what you want. Or, are you trying to create a picker that has a list of full dates in one big wheel? And what format, exactly do you want?
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
You need to provide more information about what you want to do.
Do you want your app to localize to different country's date formats? Specific date formats have the disadvantage that they don't handle different "locales" very well (if at all). It's usually better to ask for a "date style" and let the system decide how to format it. That way, if your customer is in a European country, they'll get day month year, and if they are in the US, they'll get our (strange) month day year format.
Are you trying create a custom version of the UIDatePicker control? In the US, at least, a date picker has 3 wheels, where the left wheel is the month name, the the middle wheel is the day of the month, and the right wheel is the year. That sounds like what you want. Or, are you trying to create a picker that has a list of full dates in one big wheel? And what format, exactly do you want?
Thanks for your reply Duncan. I need to create a calendar not like UIDatePicker which allows only one format Month/Date/Year. Calendar should allow the user to specify his preferred date format like "13 December,2010" or "Dec 13,2010". I'm not talking about "locale".Simply, i want to present the UIDatePicker in a better way.
Thanks for your reply Duncan. I need to create a calendar not like UIDatePicker which allows only one format Month/Date/Year. Calendar should allow the user to specify his preferred date format like "13 December,2010" or "Dec 13,2010". I'm not talking about "locale".Simply, i want to present the UIDatePicker in a better way.
There's quite a bit of work in what you want to do. You need to generate arrays of month names, day number strings, and year strings. You'll need to build a multi-segment picker and set it up to use the day, month, and year arrays as the contents of each spinner in the picker. If you want the picker to be able to reorder the month, day, and year spinners based on a user preference or some other method, you'll need to think through the logic of keeping track of which spinner contains each value, and converting the indexes back to a date.
This is a custom control, and I doubt if there's any tutorial or guide to doing what you want to do. It means writing a page or two of fairly complex code.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
There's quite a bit of work in what you want to do. You need to generate arrays of month names, day number strings, and year strings. You'll need to build a multi-segment picker and set it up to use the day, month, and year arrays as the contents of each spinner in the picker. If you want the picker to be able to reorder the month, day, and year spinners based on a user preference or some other method, you'll need to think through the logic of keeping track of which spinner contains each value, and converting the indexes back to a date.
This is a custom control, and I doubt if there's any tutorial or guide to doing what you want to do. It means writing a page or two of fairly complex code.