Commit 2c149765 authored by Skye Yu's avatar Skye Yu

fix(send schedule info): time slice

parent fcbaf8e9
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]);
......
...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment