Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
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
Skye Yu
jensen
Commits
2c149765
Commit
2c149765
authored
Dec 12, 2024
by
Skye Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(send schedule info): time slice
parent
fcbaf8e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
jensen.js
src/utils/jensen.js
+3
-3
utils.js
src/utils/utils.js
+4
-0
No files found.
src/utils/jensen.js
View file @
2c149765
import
{
Logger
as
internalLogger
,
formatTime
,
shortcutKeys
}
from
'./utils'
;
import
{
Logger
as
internalLogger
,
formatTime
,
shortcutKeys
,
sliceTime
}
from
'./utils'
;
const
INVAILD
=
0x00
;
const
INVAILD
=
0x00
;
const
QUERY_DEVICE_INFO
=
0x01
;
const
QUERY_DEVICE_INFO
=
0x01
;
...
@@ -920,8 +920,8 @@ Jensen.prototype.sendScheduleInfo = function (infos) {
...
@@ -920,8 +920,8 @@ Jensen.prototype.sendScheduleInfo = function (infos) {
let
startDate
=
new
Array
(
7
).
fill
(
0
);
let
startDate
=
new
Array
(
7
).
fill
(
0
);
let
endDate
=
new
Array
(
7
).
fill
(
0
);
let
endDate
=
new
Array
(
7
).
fill
(
0
);
if
(
info
.
startDate
&&
info
.
endDate
)
{
if
(
info
.
startDate
&&
info
.
endDate
)
{
startDate
=
formatTime
(
info
.
startDate
);
startDate
=
sliceTime
(
formatTime
(
info
.
startDate
)
);
endDate
=
formatTime
(
info
.
endDate
);
endDate
=
sliceTime
(
formatTime
(
info
.
endDate
)
);
}
}
const
reserved
=
0x00
;
// 预留
const
reserved
=
0x00
;
// 预留
bodys
=
bodys
.
concat
([...
startDate
,
...
endDate
,
reserved
,
...
codes
]);
bodys
=
bodys
.
concat
([...
startDate
,
...
endDate
,
reserved
,
...
codes
]);
...
...
src/utils/utils.js
View file @
2c149765
...
@@ -76,6 +76,10 @@ export const formatTime = (date) => {
...
@@ -76,6 +76,10 @@ export const formatTime = (date) => {
return
str
;
return
str
;
};
};
export
function
sliceTime
(
input
)
{
return
input
.
match
(
/.
{1,2}
/g
).
map
(
Number
);
}
const
keyMap
=
{
const
keyMap
=
{
CUSTOM_1
:
0x01
,
CUSTOM_1
:
0x01
,
A
:
0x04
,
A
:
0x04
,
...
...
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