Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Use this code:
You can test this code from the console. Here is a screenshot with some dummy text set as the description and before the code is executed.
Here is a screenshot after the code is executed:
Notes:
1) This code uses QuickBase's chosen loader library requirejs to load the moment library which is already configured (because QuickBase uses itself uses it on various pages).
2) If you have any need to manipulate dates within your script solutions you should use the moment library as it support every conceivable date manipulation under the sun
MomentJS Library
https://momentjs.com/
If you need further assistance feel free to contact me off-world using the information in my profile:
https://getsatisfaction.com/people/dandiebolt
require(['moment'], function(moment) {
var fromDate = moment().subtract(3, 'months').format('MM/DD/YYYY');
var toDate = moment().format('MM/DD/YYYY');
$("#introText td").html('From ${fromDate} to ${toDate}');
});
You can test this code from the console. Here is a screenshot with some dummy text set as the description and before the code is executed.
Here is a screenshot after the code is executed:
Notes:
1) This code uses QuickBase's chosen loader library requirejs to load the moment library which is already configured (because QuickBase uses itself uses it on various pages).
2) If you have any need to manipulate dates within your script solutions you should use the moment library as it support every conceivable date manipulation under the sun
MomentJS Library
https://momentjs.com/
If you need further assistance feel free to contact me off-world using the information in my profile:
https://getsatisfaction.com/people/dandiebolt
_anomDiebolt_
7 years agoQrew Elite
>How do you get the code to initiate?
I pasted it into the console while displaying a summary report. You may have to have some dummy text in the report description in order for QuickBase to render the description in the first place. My code merely changed the description.
I pasted it into the console while displaying a summary report. You may have to have some dummy text in the report description in order for QuickBase to render the description in the first place. My code merely changed the description.