Skip to content

Commit

Permalink
feat: default data for Input.Date as GDS theme
Browse files Browse the repository at this point in the history
  • Loading branch information
meenahoda committed Oct 15, 2021
1 parent 4984796 commit a100bd9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ module.exports = async function extractDefaults (cardscript) {
if (defaultValue !== undefined) {
applyDefaultValue(defaultValues, defaultValue === '$TODAY' ? new Date() : defaultValue, apiLookupPath, cardListPath, element.id)
}

if (element.theme === 'GDS') {
const defaultValue_ = {
date: null,
month: null,
year: null
}

applyDefaultValue(defaultValues, defaultValue_, apiLookupPath, cardListPath, element.id + '_$DATE')
}

break
case 'Input.Number':
case 'Input.Slider':
Expand Down

0 comments on commit a100bd9

Please sign in to comment.