//
//  SLTargetModel.m
//  SLAiELTS
//
//  Created by Gusont on 2023/3/15.
//

#import "SLTargetModel.h"

@implementation SLTargetModel

- (NSInteger)getGoalTimeInterval {
    if (self.goalTime == nil) {
        return 0;
    }
    NSDateFormatter*dateFormatter=[[NSDateFormatter alloc]init];// 创建一个时间格式化对象
    [dateFormatter setDateFormat:@"yyyy年MM月dd日"];//设定时间的格式
    NSDate *tempDate=[dateFormatter dateFromString:self.goalTime];//将字符串转换为时间对象
    NSString *timeStr = [NSString stringWithFormat:@"%ld",(long)[tempDate timeIntervalSince1970]];
    double t = [tempDate timeIntervalSince1970];
    double n = [[NSDate date] timeIntervalSince1970];
    NSInteger i = t - n;
    NSInteger t1 = i > 0 ? i / (60 * 60 * 24) + 1 : 0;
    return t1;
}

- (NSArray *)getTargetScoreArr {
    return @[self.hearing, self.read, self.speech, self.writing];
}

@end
