Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
b01fdbb4
Commit
b01fdbb4
authored
6 years ago
by
tina
Browse files
Options
Downloads
Patches
Plain Diff
places todayString outside of reduce
parent
20c08674
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/calendar.js
+4
-2
4 additions, 2 deletions
components/calendar.js
with
4 additions
and
2 deletions
components/calendar.js
+
4
−
2
View file @
b01fdbb4
...
@@ -58,6 +58,7 @@ export default class CalendarView extends Component {
...
@@ -58,6 +58,7 @@ export default class CalendarView extends Component {
}
}
function
toCalFormat
(
bleedingDaysSortedByDate
)
{
function
toCalFormat
(
bleedingDaysSortedByDate
)
{
const
todayDateString
=
LocalDate
.
now
().
toString
()
return
bleedingDaysSortedByDate
.
reduce
((
acc
,
day
)
=>
{
return
bleedingDaysSortedByDate
.
reduce
((
acc
,
day
)
=>
{
acc
[
day
.
date
]
=
{
acc
[
day
.
date
]
=
{
customStyles
:
{
customStyles
:
{
...
@@ -66,7 +67,7 @@ function toCalFormat(bleedingDaysSortedByDate) {
...
@@ -66,7 +67,7 @@ function toCalFormat(bleedingDaysSortedByDate) {
}
}
}
}
}
}
if
(
day
.
date
===
LocalDate
.
now
().
to
String
()
)
{
if
(
day
.
date
===
todayDate
String
)
{
acc
[
day
.
date
].
customStyles
.
text
=
styles
.
calendarToday
acc
[
day
.
date
].
customStyles
.
text
=
styles
.
calendarToday
}
}
return
acc
return
acc
...
@@ -75,6 +76,7 @@ function toCalFormat(bleedingDaysSortedByDate) {
...
@@ -75,6 +76,7 @@ function toCalFormat(bleedingDaysSortedByDate) {
function
predictionToCalFormat
(
predictedDays
)
{
function
predictionToCalFormat
(
predictedDays
)
{
if
(
!
predictedDays
.
length
)
return
{}
if
(
!
predictedDays
.
length
)
return
{}
const
todayDateString
=
LocalDate
.
now
().
toString
()
const
middleIndex
=
(
predictedDays
[
0
].
length
-
1
)
/
2
const
middleIndex
=
(
predictedDays
[
0
].
length
-
1
)
/
2
return
predictedDays
.
reduce
((
acc
,
setOfDays
)
=>
{
return
predictedDays
.
reduce
((
acc
,
setOfDays
)
=>
{
setOfDays
.
reduce
((
accSet
,
day
,
i
)
=>
{
setOfDays
.
reduce
((
accSet
,
day
,
i
)
=>
{
...
@@ -89,7 +91,7 @@ function predictionToCalFormat(predictedDays) {
...
@@ -89,7 +91,7 @@ function predictionToCalFormat(predictedDays) {
}
}
}
}
}
}
if
(
day
===
LocalDate
.
now
().
to
String
()
)
{
if
(
day
===
todayDate
String
)
{
accSet
[
day
].
customStyles
.
text
=
Object
.
assign
(
accSet
[
day
].
customStyles
.
text
=
Object
.
assign
(
{},
{},
styles
.
calendarToday
,
styles
.
calendarToday
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment