I think my question is clear ! but I modify it again .
Assume my calendar app has some part , one shows date , one for storing text , and another is button which forward and backward date and time .
user needs save some note for today or tomorrow or another day , actually it's a kind of reminder . What I try to do is that create something which users can save their notes according to to the specific date ...
for example I write something for tomorrow and this text should be saved in 4 Feb or whatever date and the text should be shown in 4Feb not 5 2 6 13 Feb .
I have created a custom class which shows dates and time
myCustomClass.m:
Code:
- (NSString *) showFullDate {
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
//ADDING DAY
offsetComponents = [[NSDateComponents alloc] init];
offsetComponents.day = _dayNumber;
NSDate *nextDate = [calendar dateByAddingComponents:offsetComponents toDate:[NSDate date] options:0];
[dateFormatter setDateFormat:@"EEEE ، d MMMM"];
NSString *currDay = [dateFormatter stringFromDate:nextDate];
[NSString stringWithFormat:@"%@",currDay];
[calendar release];
[dateFormatter release];
return currDay;
}
and then if I would move dates to forward days I use this method :
Code:
- (void)nextDay {
[self showFullDate];
_dayNumber ++;
}
in my view controller I use this method
myLable.text = [customClass showFullDate];
so the saving date should be equal to the showFullDate .