How to Modify Obsidian Usage Days Counter in JavaScript Code
This code snippet calculates the number of days you've used Obsidian. To modify the code to show you've used 200 days, follow these steps:
-
Set a Fixed Value for
total: Replace the original calculation fortotalwith a direct assignment of 200:let total = 200; -
Update
totalDays: Modify thetotalDaysvariable to include the fixedtotalvalue:let totalDays = 'You have used *Obsidian* ' + total + ' days.';
Now, totalDays will display 'You have used Obsidian 200 days.' You can customize the string further to match your desired format.
You can then use the totalDays variable in your code as needed, for example, displaying it in the console, rendering it on a webpage, or performing other actions.
原文地址: https://www.cveoy.top/t/topic/iGR 著作权归作者所有。请勿转载和采集!