Skip to content

Commit

Permalink
RENDEZVOUS-757: Today's date prefilled when creating a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
elysajouve committed Jun 29, 2022
1 parent dac23da commit f8181e5
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
<#assign endDateLabel='#i18n{appointment.create_comment.labelEndingValidityDate}'>
<#assign endDateHelp='#i18n{appointment.create_comment.labelEndingValidityDate}'>
<#assign endTimeLabel='#i18n{appointment.create_comment.labelEndingValidityTime}'>
<#assign startDateValueParams = 'today'/>

<#assign startDateIsToday = true />
</#switch>
<@modalHeader modalTitle=modalTitle />
<@modalBody>
Expand All @@ -192,8 +193,8 @@
</@formGroup>
<@formGroup labelFor='startingValidityDate' labelKey=startDateLabel mandatory=true rows=2>
<@inputGroup class='date' id='${idStartingDate}Group'>
<#if startDateValueParams??>
<@input type='date' name='startingValidityDate' id=idStartingDate defaultDate=startDateValueParams />
<#if startDateIsToday>
<@input type='date' name='startingValidityDate' id=idStartingDate defaultDate='today' />
<#else>
<@input type='date' name='startingValidityDate' id=idStartingDate />
</#if>
Expand Down Expand Up @@ -283,12 +284,6 @@
$('#${idComment} ~ *').html('');
$('#${idComment}').parents('.form-group').removeClass('has-error');

if(!$('#${idStartingDate}').val()) {
console.log("test test");
}



dStart=$('#${idStartingDate}').val(),dEnd=$('#${idEndingDate}').val();

if( moment(dEnd).isBefore( dStart ) ){
Expand Down Expand Up @@ -424,7 +419,7 @@
localStorage.setItem( 'commentContext', moment(formValues.comment_start).format('DD/MM/YYYY') );
tinyMCE.activeEditor.setContent( formValues.comment_text );
$( '#modify-comment input[name="id_comment"]' ).val( formValues.id_comment.slice(1) );
// Update FlatPickr (function updateInputDate in macro_datetimepicker.html)
// Update Date fields (function updateInputDate in macro_datetimepicker.html)
updateInputDate(modifyStartingValidityDate_fp,moment(formValues.comment_start).format('DD/MM/YYYY'));
updateInputDate(modifyEndingValidityDate_fp,moment(formValues.comment_end).format('DD/MM/YYYY'));
$( '#modify-comment input[name="startingValidityTime"]' ).val( formValues.comment_start_time );
Expand Down

0 comments on commit f8181e5

Please sign in to comment.