Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
4682abaf
Commit
4682abaf
authored
Oct 23, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FIX: use correct day of week for schedule creation
parent
ac7a13bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/EmissionManagerModalCreate.vue
View file @
4682abaf
...
...
@@ -123,6 +123,7 @@ export default {
this
.
newSchedule
.
schedule
.
tend
=
this
.
valuePick
.
tend
this
.
newSchedule
.
schedule
.
until
=
this
.
valuePick
.
until
this
.
newSchedule
.
schedule
.
rrule
=
this
.
valuePick
.
rrule
this
.
newSchedule
.
schedule
.
byweekday
=
this
.
getWeekdayFromApiDate
(
this
.
valuePick
.
dstart
)
// now generate the URL and POST our new schedule
let
uri
=
process
.
env
.
VUE_APP_API_STEERING_SHOWS
+
this
.
$parent
.
shows
[
this
.
$parent
.
currentShow
].
id
+
'
/schedules/
'
axios
.
post
(
uri
,
this
.
newSchedule
,
{
...
...
@@ -199,7 +200,7 @@ export default {
this
.
newSchedule
=
{
schedule
:
{
rrule
:
1
,
show
:
21
,
show
:
0
,
byweekday
:
0
,
dstart
:
dstart
,
tstart
:
tstart
,
...
...
src/mixins/prettyDate.js
View file @
4682abaf
...
...
@@ -34,6 +34,13 @@ export default {
var
d
=
new
Date
(
date
)
return
d
.
getFullYear
()
+
'
-
'
+
leadingZero
(
d
.
getMonth
()
+
1
)
+
'
-
'
+
leadingZero
(
d
.
getDate
())
},
getWeekdayFromApiDate
:
function
(
date
)
{
let
d
=
new
Date
(
date
)
let
w
=
d
.
getDay
()
// Date.getDay() returns 0 for Sundays, but for our APIs we need 0 for Mondays
if
(
w
===
0
)
{
return
6
}
else
{
return
w
-
1
}
},
prettyDate
:
function
(
date
)
{
var
d
=
new
Date
(
date
)
var
dstring
=
''
...
...
Write
Preview
Supports
Markdown
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