Skip to content

Commit

Permalink
update datebound fix for new fieldvm
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasnteireho committed Oct 18, 2024
2 parents 2d91c8c + c5ccf23 commit 1e30603
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion index.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
window.less = {async: true, fileSync: true};
</script>

<script src=node_modules/steal/steal.production.js?v=1729277272845" cache-key="v" cache-version="1729277272845" main="a2jauthor/app"></script>
<script src=node_modules/steal/steal.production.js?v=1729292622560" cache-key="v" cache-version="1729292622560" main="a2jauthor/app"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
window.less = {async: true, fileSync: true};
</script>

<script src=node_modules/steal/steal.production.js?v=1729277478196" cache-key="v" cache-version="1729277478196" main="a2jauthor/app"></script>
<script src=node_modules/steal/steal.production.js?v=1729292765323" cache-key="v" cache-version="1729292765323" main="a2jauthor/app"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a2jauthor",
"version": "10.2.0-6",
"version": "10.2.0-12",
"description": "A2J Authoring App GUI.",
"license": "GNU AGPL v3.0",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/footer/footerVersion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

const version = {
number: '10.2.0-6',
number: '10.2.0-12',
date: '2024-10-18'
}

Expand Down
7 changes: 3 additions & 4 deletions src/pages-tab/components/page-fields/page-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const PageFieldsVM = DefineMap.extend('PageFieldsVM', {
},

parseDateBound (boundedDate) {
let textDate = '' // assume unfilled
let textDate = ''// assume unfilled

if (boundedDate) {
if (boundedDate !== 'TODAY') {
Expand All @@ -190,7 +190,7 @@ export const PageFieldsVM = DefineMap.extend('PageFieldsVM', {
boundedDate.substr(2, 2)
}
}

return textDate
},

Expand All @@ -201,8 +201,7 @@ export const PageFieldsVM = DefineMap.extend('PageFieldsVM', {
mangleDateBound (el) {
let str = el.value.split(',').join('')
str = str.split('-').join('')
console.log('JAWN: ' + str)


str =
str.substr(4, 2) + '/' +
str.substr(6, 2) + '/' +
Expand Down
27 changes: 14 additions & 13 deletions src/pages-tab/components/page-fields/page-fields.stache
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,19 @@
type="date" placeholder="min"
id="min-date"
pattern="TODAY|(?:^-(?=.*\d))|\d*"
value="{{parseDateBound(field.field.min)}}"
on:blur="field.field.min = mangleDateBound(scope.element)"
{{ #eq(field.field.min, "TODAY")}} disabled {{/eq}}
value="{{parseDateBound(fieldVM.field.min)}}"
on:blur="fieldVM.field.min = mangleDateBound(scope.element)"
{{ #eq(fieldVM.field.min, "TODAY")}} disabled {{/eq}}
>

<div name="today-min" class="{{^if(field.canRequire)}}hidden{{/if}}">
<div name="today-min">
<div class="checkbox">
<label>
<input type="checkbox"
{{ #eq(field.field.min, "TODAY")}} checked {{/eq}}
on:blur="field.field.min = checktoToday(scope.element)"
{{ #eq(fieldVM.field.min, "TODAY")}} checked {{/eq}}
on:blur="fieldVM.field.min = checktoToday(scope.element)"
on:click="toggleDateBoundEnable('#min-date')"
value:bind="field.field.min"
value:bind="fieldVM.field.min"
value="TODAY"> TODAY
</label>
</div>
Expand All @@ -137,18 +137,19 @@
<input class="form-control ui-widget editable"
type="date" placeholder="max"
id="max-date"
value="{{parseDateBound(field.field.max)}}"
value="{{parseDateBound(fieldVM.field.max)}}"
pattern="TODAY|(?:^-(?=.*\d))|\d*"
{{ #eq(field.field.max, "TODAY")}} disabled {{/eq}}
on:blur="field.field.max = mangleDateBound(scope.element)"
{{ #eq(fieldVM.field.max, "TODAY")}} disabled {{/eq}}
on:blur="fieldVM.field.max = mangleDateBound(scope.element)"
>
<div name="today-max" class="{{^if(field.canRequire)}}hidden{{/if}}">
<div name="today-max">
<div class="checkbox">
<label>
<input type="checkbox"
{{ #eq(field.field.max, "TODAY")}} checked {{/eq}}
on:blur="field.field.max = TODAY"
{{ #eq(fieldVM.field.max, "TODAY")}} checked {{/eq}}
on:blur="fieldVM.field.max = checktoToday(scope.element)"
on:click="toggleDateBoundEnable('#max-date')"
value:bind="fieldVM.field.max"
value="TODAY"> TODAY
</label>
</div>
Expand Down

0 comments on commit 1e30603

Please sign in to comment.