// // IfishPlaybackViewCell.m // Ifish // // Created by imac on 16/12/13. // Copyright © 2016年 lianxiang. All rights reserved. // #import "IfishPlaybackViewCell.h" @implementation IfishPlaybackViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.playImageView.image = LXImageWithImageName(@"playBackIcon"); } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } -(void)setModel:(GWPlaybackFileModel *)model { _model=model; NSString*start=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateFormat = @"yyyyMMddHHmmss"; NSDate*date=model.date; if (!date ) { date= [formatter dateFromString:[start stringByAppendingFormat:@"%02ld",model.second]]; } NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; if (date) { date=[date dateByAddingTimeInterval:model.time]; formatter.dateFormat=@"yyyyMMddHHmm"; end=[formatter stringFromDate:date]; } else { } self.startTimeLabel.text=start; self.endTimeLabel.text=end; } @end