// // 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 = @"yyyyMMddHHmm"; NSDate*date=[formatter dateFromString:start]; NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; if (date) { if ([model.cType isEqualToString:@"S"]) { date=[date dateByAddingTimeInterval:model.time]; } else { date=[date dateByAddingTimeInterval:model.time*60]; } end=[formatter stringFromDate:date]; } else { } self.startTimeLabel.text=start; self.endTimeLabel.text=end; } @end