Create vue component to manage date range logic

This commit is contained in:
leigh-mil
2019-09-23 15:27:09 -04:00
parent ae57baf455
commit 0e641a9064
5 changed files with 229 additions and 141 deletions

View File

@@ -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],

View 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,
}
},
}