mirror of
https://github.com/leanote/leanote-ios.git
synced 2025-10-13 22:57:12 +00:00
dateStr
This commit is contained in:
@@ -233,7 +233,8 @@
|
||||
@"IsTrash": note.isTrash,
|
||||
@"IsBlog": note.isBlog, // 是否是博客
|
||||
// FileDatas: note.FileDatas,
|
||||
@"Tags[0]": @""
|
||||
@"Tags[0]": @"",
|
||||
@"UpdatedTime": [Common dateStr:note.updatedTime]
|
||||
}];
|
||||
// 处理标签
|
||||
NSArray *tags = [note.tags componentsSeparatedByString:@","];
|
||||
@@ -245,7 +246,7 @@
|
||||
[params setObject:eachTag forKey:[NSString stringWithFormat:@"Tags[%d]", i]];
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
// 处理文件
|
||||
if(![Common isNullOrNil:files]) {
|
||||
int i = 0;
|
||||
@@ -263,7 +264,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if([note.isContentDirty boolValue]) {
|
||||
params[@"Content"] = content;
|
||||
}
|
||||
@@ -310,6 +310,8 @@
|
||||
// FileDatas: note.FileDatas,
|
||||
@"Tags[0]": @"",
|
||||
@"Content": content,
|
||||
@"CreatedTime": [Common dateStr:note.createdTime],
|
||||
@"UpdatedTime": [Common dateStr:note.updatedTime]
|
||||
}];
|
||||
// 处理标签
|
||||
NSArray *tags = [note.tags componentsSeparatedByString:@","];
|
||||
|
@@ -35,4 +35,5 @@
|
||||
+ (BOOL)isiOSVersionEarlierThan8;
|
||||
|
||||
+ (NSDate *)goDate:(NSString *)dateStr;
|
||||
+ (NSString *)dateStr:(NSDate *)date;
|
||||
@end
|
||||
|
@@ -223,4 +223,15 @@
|
||||
return date;
|
||||
}
|
||||
|
||||
// 返回2012-12-32 12:03:30
|
||||
+ (NSString *)dateStr:(NSDate *)date
|
||||
{
|
||||
if ([self isNullOrNil:date]) {
|
||||
date =[NSDate date];
|
||||
}
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
|
||||
return [dateFormatter stringFromDate:date];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user