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
stw
stwkit
Commits
b5ee28eb
Commit
b5ee28eb
authored
Oct 31, 2017
by
Tomas Pettersson
🏸
Browse files
limits period date to be within max and min
parent
14d0d1e2
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
src/components/cards.js
View file @
b5ee28eb
...
...
@@ -589,6 +589,9 @@ var STWkit;
PeriodCard
.
prototype
.
changeFn
=
function
(
changeCard
)
{
var
self
=
this
;
if
((
typeof
changeCard
.
obsDateInput
!==
'
undefined
'
)
&&
(
typeof
changeCard
.
obsTimeInput
!==
'
undefined
'
))
{
var
date
=
moment
.
utc
(
changeCard
.
obsDateInput
.
value
+
'
'
+
changeCard
.
obsTimeInput
.
value
,
self
.
datetimeFormat
);
if
(
date
.
isBefore
(
self
.
minDate
)
||
date
.
isAfter
(
self
.
maxDate
))
return
;
self
.
startDateInput
.
value
=
changeCard
.
obsDateInput
.
value
;
self
.
startTimeInput
.
value
=
changeCard
.
obsTimeInput
.
value
;
self
.
updateFromStartDate
();
...
...
src/components/cards.js.map
View file @
b5ee28eb
This diff is collapsed.
Click to expand it.
src/components/cards.ts
View file @
b5ee28eb
...
...
@@ -651,6 +651,8 @@ module STWkit {
public
changeFn
(
changeCard
)
{
var
self
=
this
;
if
((
typeof
changeCard
.
obsDateInput
!==
'
undefined
'
)
&&
(
typeof
changeCard
.
obsTimeInput
!==
'
undefined
'
))
{
var
date
=
moment
.
utc
(
changeCard
.
obsDateInput
.
value
+
'
'
+
changeCard
.
obsTimeInput
.
value
,
self
.
datetimeFormat
);
if
(
date
.
isBefore
(
self
.
minDate
)
||
date
.
isAfter
(
self
.
maxDate
))
return
;
self
.
startDateInput
.
value
=
changeCard
.
obsDateInput
.
value
;
self
.
startTimeInput
.
value
=
changeCard
.
obsTimeInput
.
value
;
self
.
updateFromStartDate
();
...
...
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