function gettimeLine(){ const now = new Date();
now.setHours( 0 ); now.setMinutes( 0 ); now.setSeconds( 1 );
const year = now.getFullYear(); const month = now.getMonth() + 1; const $year = now.getFullYear() - ( month < 4 ? 1 : 0 ); const days = ( new Date( `${ $year + 1 }-04-01` ) - new Date( `${ $year }-04-01` ) ) / 86400000;
return ( ( now - new Date( `${ $year }-04-01` ) ) / 86400000 / days * 100 ).toFixed( 2 ) + '%';}undefinedgettimeLine()"30.32%"
转载于:https://www.cnblogs.com/LSSSunshine/p/7219084.html
相关资源:时间轴_BootStrap制作的