Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
54
Merge Requests
54
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
gr-ssv
Sailassist
Commits
9cdd7983
Commit
9cdd7983
authored
Sep 10, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャット期限対応 (30日間)
parent
ea771d63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
14 deletions
+37
-14
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+3
-3
ChatView.swift
Seilassist/Sailassist/Chat/ChatView.swift
+28
-11
DateTextLib.swift
Seilassist/Sailassist/Lib/DateTextLib.swift
+6
-0
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
9cdd7983
...
...
@@ -1307,7 +1307,7 @@
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
3
;
CURRENT_PROJECT_VERSION
=
5
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
@@ -1353,7 +1353,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
3
;
CURRENT_PROJECT_VERSION
=
5
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
@@ -1536,7 +1536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
5
3
;
CURRENT_PROJECT_VERSION
=
5
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
Seilassist/Sailassist/Chat/ChatView.swift
View file @
9cdd7983
...
...
@@ -31,19 +31,21 @@ struct ChatView: View {
.
frame
(
height
:
20
)
ForEach
(
message
.
messages
,
id
:
\
.
messageId
)
{
msg
in
if
msg
.
message
!=
nil
{
if
msg
.
from
==
Preferences
.
UserName
{
//自分のメッセージ
MyChatContentView
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
else
{
//他人のメッセージ
OtherChatContentView
(
message
:
msg
)
if
displayPeriod
(
messageTime
:
msg
.
time
)
{
if
msg
.
message
!=
nil
{
if
msg
.
from
==
Preferences
.
UserName
{
//自分のメッセージ
MyChatContentView
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
else
{
//他人のメッセージ
OtherChatContentView
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
}
else
{
AlertChatMessage
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
}
else
{
AlertChatMessage
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
}
}
...
...
@@ -111,6 +113,21 @@ struct ChatView: View {
}
.
background
(
ColorSet
.
BackgroundPrimary
.
color
)
}
func
displayPeriod
(
messageTime
:
String
)
->
Bool
{
var
period
=
false
var
interval
=
0.0
if
let
megTime
=
DateTextLib
.
ISO8601Text2Date
(
messageTime
)
{
interval
=
Date
.
now
.
timeIntervalSince
(
megTime
)
}
if
interval
<=
unixTimeMonth
{
//2,592,000.0
period
=
true
}
return
period
}
}
struct
AlertChatMessage
:
View
{
...
...
Seilassist/Sailassist/Lib/DateTextLib.swift
View file @
9cdd7983
...
...
@@ -9,6 +9,12 @@
//import UIKit
import
Foundation
let
unixTimeHour
=
3600.0
let
unixTimeDay
=
86400.0
let
unixTimeMonth
=
2592000.0
let
unixTimeYear
=
31536000.0
class
DateTextLib
:
NSObject
{
/// Date型をグレゴリオ暦日付文字列にする
...
...
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