vendredi 14 août 2015

hwo to get After one year

I have get Sequence of month using following code

NSDate *aDate = [NSDate dateWithTimeInterval:row*30*24*60*60  sinceDate:self.earliestPresentedDate];

    NSDateComponents *components = [self.calendar components:(NSEraCalendarUnit|NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit) fromDate:[NSDate date]];
    NSDate *today = [self.calendar dateFromComponents:components];
    components = [self.calendar components:(NSEraCalendarUnit|NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit) fromDate:aDate];
    NSDate *otherDate = [self.calendar dateFromComponents:components];

    if ([today isEqualToDate:otherDate]) {

    } else {
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        formatter.locale = [NSLocale currentLocale];
        formatter.dateFormat = @"MMM ";

        [lblDate setText:[formatter stringFromDate:aDate]];
    }

i want to get Sequence of year how to get...please give solution



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire