Create vue component to manage date range logic
This commit is contained in:
@@ -7,6 +7,7 @@ import Modal from '../mixins/modal'
|
||||
import optionsinput from './options_input'
|
||||
import textinput from './text_input'
|
||||
import clindollaramount from './clin_dollar_amount'
|
||||
import PopDateRange from './pop_date_range'
|
||||
|
||||
const TOTAL_AMOUNT = 'total_amount'
|
||||
const OBLIGATED_AMOUNT = 'obligated_amount'
|
||||
@@ -23,6 +24,7 @@ export default {
|
||||
optionsinput,
|
||||
textinput,
|
||||
clindollaramount,
|
||||
PopDateRange,
|
||||
},
|
||||
|
||||
mixins: [Modal],
|
||||
|
30
js/components/pop_date_range.js
Normal file
30
js/components/pop_date_range.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import DateSelector from './date_selector'
|
||||
|
||||
export default {
|
||||
name: 'pop-date-range',
|
||||
|
||||
components: {
|
||||
DateSelector,
|
||||
},
|
||||
|
||||
props: {
|
||||
initialMinStartDate: String,
|
||||
initialMaxEndDate: String,
|
||||
initialStartDate: String,
|
||||
initialEndDate: String,
|
||||
clinIndex: Number,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
return {
|
||||
startDate: this.initialStartDate,
|
||||
endDate: this.initialEndDate,
|
||||
startValid: false,
|
||||
endValid: false,
|
||||
minStartDate: this.initialMinStartDate,
|
||||
maxStartDate: this.initialMaxEndDate,
|
||||
minEndDate: this.initialMinStartDate,
|
||||
maxEndDate: this.initialMaxEndDate,
|
||||
}
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user