Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
c951aad8
Commit
c951aad8
authored
Jul 18, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix TimePeriod conditional formatting
parent
9e061431
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
cell/model/ConditionalFormatting.js
cell/model/ConditionalFormatting.js
+20
-15
cell/model/Workbook.js
cell/model/Workbook.js
+1
-1
No files found.
cell/model/ConditionalFormatting.js
View file @
c951aad8
...
@@ -146,60 +146,65 @@
...
@@ -146,60 +146,65 @@
CConditionalFormattingRule
.
prototype
.
getTimePeriod
=
function
()
{
CConditionalFormattingRule
.
prototype
.
getTimePeriod
=
function
()
{
var
start
,
end
;
var
start
,
end
;
var
now
=
new
Date
();
var
now
=
new
Date
();
now
.
setUTCHours
(
0
,
0
,
0
,
0
);
switch
(
this
.
timePeriod
)
{
switch
(
this
.
timePeriod
)
{
case
AscCommonExcel
.
ST_TimePeriod
.
last7Days
:
case
AscCommonExcel
.
ST_TimePeriod
.
last7Days
:
now
.
setUTCDate
(
now
.
getUTCDate
()
+
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
-
7
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
-
7
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
lastMonth
:
case
AscCommonExcel
.
ST_TimePeriod
.
lastMonth
:
now
.
setUTCDate
(
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
now
.
set
Month
(
now
.
get
Month
()
-
1
);
now
.
set
UTCMonth
(
now
.
getUTC
Month
()
-
1
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
thisMonth
:
case
AscCommonExcel
.
ST_TimePeriod
.
thisMonth
:
now
.
setUTCDate
(
1
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Month
(
now
.
get
Month
()
+
1
);
now
.
set
UTCMonth
(
now
.
getUTC
Month
()
+
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
nextMonth
:
case
AscCommonExcel
.
ST_TimePeriod
.
nextMonth
:
now
.
setMonth
(
now
.
getMonth
()
+
1
);
now
.
setUTCDate
(
1
);
now
.
setUTCMonth
(
now
.
getUTCMonth
()
+
1
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Month
(
now
.
get
Month
()
+
1
);
now
.
set
UTCMonth
(
now
.
getUTC
Month
()
+
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
lastWeek
:
case
AscCommonExcel
.
ST_TimePeriod
.
lastWeek
:
now
.
set
Date
(
now
.
getDate
()
-
now
.
get
Day
());
now
.
set
UTCDate
(
now
.
getUTCDate
()
-
now
.
getUTC
Day
());
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
-
7
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
-
7
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
thisWeek
:
case
AscCommonExcel
.
ST_TimePeriod
.
thisWeek
:
now
.
set
Date
(
now
.
getDate
()
-
now
.
get
Day
());
now
.
set
UTCDate
(
now
.
getUTCDate
()
-
now
.
getUTC
Day
());
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
+
7
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
+
7
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
nextWeek
:
case
AscCommonExcel
.
ST_TimePeriod
.
nextWeek
:
now
.
set
Date
(
now
.
getDate
()
-
now
.
get
Day
()
+
7
);
now
.
set
UTCDate
(
now
.
getUTCDate
()
-
now
.
getUTC
Day
()
+
7
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
+
7
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
+
7
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
yesterday
:
case
AscCommonExcel
.
ST_TimePeriod
.
yesterday
:
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
-
1
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
-
1
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
today
:
case
AscCommonExcel
.
ST_TimePeriod
.
today
:
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
+
1
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
+
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
case
AscCommonExcel
.
ST_TimePeriod
.
tomorrow
:
case
AscCommonExcel
.
ST_TimePeriod
.
tomorrow
:
now
.
set
Date
(
now
.
get
Date
()
+
1
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
+
1
);
start
=
now
.
getExcelDate
();
start
=
now
.
getExcelDate
();
now
.
set
Date
(
now
.
get
Date
()
+
1
);
now
.
set
UTCDate
(
now
.
getUTC
Date
()
+
1
);
end
=
now
.
getExcelDate
();
end
=
now
.
getExcelDate
();
break
;
break
;
}
}
...
...
cell/model/Workbook.js
View file @
c951aad8
...
@@ -2899,7 +2899,7 @@
...
@@ -2899,7 +2899,7 @@
compareFunction
=
(
function
(
period
)
{
compareFunction
=
(
function
(
period
)
{
return
function
(
val
,
c
)
{
return
function
(
val
,
c
)
{
var
n
=
parseFloat
(
val
);
var
n
=
parseFloat
(
val
);
return
period
.
start
<=
n
&&
n
<
=
period
.
end
;
return
period
.
start
<=
n
&&
n
<
period
.
end
;
};
};
})(
oRule
.
getTimePeriod
());
})(
oRule
.
getTimePeriod
());
}
else
{
}
else
{
...
...
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