GrapesJS / components-countdown

Simple countdown component for the GrapesJS Editor
BSD 3-Clause "New" or "Revised" License
22 stars 37 forks source link

Countdown date update issue. #6

Closed YashPrince closed 6 years ago

YashPrince commented 6 years ago

@artf I am using component-countdown plugin everything working fine we are saving component and style in JSON and retrieve in JSON format. Problem is that we can not update count down date once we use editor.getComponents() . I have debugged the code it was due to once we save the countdown it create the script attribute in editor.getSelected().attributes.script and once it set it didnot update again. I have checked editor.getSelected().attributes.startfrom it update the value of it but can not update the script attribute once it created.

countdown

artf commented 6 years ago

Seems to me an old bug, are you using the latest version of grapesjs?

YashPrince commented 6 years ago

No but I have fixed it by

if(e.attributes.startfrom!=""){ n=n.replace(/(\d{4})-(\d{2})-(\d{2})/, '{[ startfrom ]}'); }