Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
d9ce71d3
Commit
d9ce71d3
authored
Jun 26, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间展示
parent
69de5da0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
5 deletions
+47
-5
YHActivityModel.swift
...odules/Community(社区)/Activity(活动)/M/YHActivityModel.swift
+43
-1
YHActivityListCell.swift
...les/Community(社区)/Activity(活动)/V/YHActivityListCell.swift
+1
-1
YHActivityTitleItemView.swift
...ommunity(社区)/Activity(活动)/V/YHActivityTitleItemView.swift
+1
-1
YHActivityTravelitemView.swift
...mmunity(社区)/Activity(活动)/V/YHActivityTravelitemView.swift
+1
-1
Int+Extension.swift
galaxy/galaxy/Classes/Tools/Extention/Int+Extension.swift
+1
-1
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/M/YHActivityModel.swift
View file @
d9ce71d3
...
@@ -17,7 +17,49 @@ class YHActivityModel: YHBaseModel {
...
@@ -17,7 +17,49 @@ class YHActivityModel: YHBaseModel {
var
endTime
:
String
=
""
//结束时间戳
var
endTime
:
String
=
""
//结束时间戳
var
place
:
String
=
""
//活动地点
var
place
:
String
=
""
//活动地点
var
status
:
String
=
""
//活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名
var
status
:
String
=
""
//活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名
var
checkId
:
String
=
""
//活动行程ID 仅当活动状态为2(已报名)时才大于0
private
var
beginTimeForUI
:
String
=
""
func
getDateString
()
->
String
{
if
beginTimeForUI
.
isEmpty
{
if
let
tttt
=
beginTime
.
double
()
{
//1.
// 将时间戳转换为Date对象
let
date
=
Date
(
timeIntervalSince1970
:
TimeInterval
(
tttt
))
// 创建一个DateFormatter实例
let
dateFormatter
=
DateFormatter
()
// 设置日期格式,这里设置为"年-月-日 时:分:秒"
dateFormatter
.
dateFormat
=
"yyyy-MM-dd"
// HH:mm:ss
// 使用DateFormatter将Date对象转换为字符串
let
dateString
=
dateFormatter
.
string
(
from
:
date
)
dateFormatter
.
dateFormat
=
"mm:ss"
let
titmeString
=
dateFormatter
.
string
(
from
:
date
)
// 获取Calendar的当前实例
let
calendar
=
Calendar
.
current
// 使用Calendar来获取星期几
let
weekday
=
calendar
.
component
(
.
weekday
,
from
:
date
)
// 星期几的名称,根据weekday的值,1到7分别代表周一到周日
let
weekdayName
=
[
"周日"
,
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
][
weekday
-
1
]
//3.
beginTimeForUI
=
dateString
+
" "
+
weekdayName
+
" "
+
titmeString
}
}
return
beginTimeForUI
}
var
checkId
:
String
=
""
//活动行程ID 仅当活动状态为2(已报名)时才大于0
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityListCell.swift
View file @
d9ce71d3
...
@@ -133,7 +133,7 @@ extension YHActivityListCell {
...
@@ -133,7 +133,7 @@ extension YHActivityListCell {
}
}
//
//
dateLabel
.
text
=
String
(
model
.
beginTime
)
dateLabel
.
text
=
model
.
getDateString
()
//
String(model.beginTime)
//
//
detailLabel
.
text
=
model
.
place
detailLabel
.
text
=
model
.
place
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityTitleItemView.swift
View file @
d9ce71d3
...
@@ -106,7 +106,7 @@ extension YHActivityTitleItemView {
...
@@ -106,7 +106,7 @@ extension YHActivityTitleItemView {
"""
"""
}
}
timeLable
.
text
=
String
(
model
.
beginTime
)
timeLable
.
text
=
model
.
getDateString
()
//
String(model.beginTime)
addressLable
.
text
=
model
.
place
addressLable
.
text
=
model
.
place
navAddressLable
.
text
=
model
.
guidance
navAddressLable
.
text
=
model
.
guidance
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityTravelitemView.swift
View file @
d9ce71d3
...
@@ -112,7 +112,7 @@ extension YHActivityTravelitemView {
...
@@ -112,7 +112,7 @@ extension YHActivityTravelitemView {
timeLable
.
text
=
String
(
model
.
beginTime
)
timeLable
.
text
=
model
.
getDateString
()
//
String(model.beginTime)
addressLable
.
text
=
model
.
place
addressLable
.
text
=
model
.
place
navAddressLable
.
text
=
model
.
guidance
navAddressLable
.
text
=
model
.
guidance
}
}
...
...
galaxy/galaxy/Classes/Tools/Extention/Int+Extension.swift
View file @
d9ce71d3
...
@@ -18,7 +18,7 @@ extension Int {
...
@@ -18,7 +18,7 @@ extension Int {
case
2
:
case
2
:
return
"女"
return
"女"
default
:
default
:
return
"
未知
"
return
""
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment