Fix bug
This commit is contained in:
		
							parent
							
								
									0481de6629
								
							
						
					
					
						commit
						f59c68022f
					
				
					 2 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -34,15 +34,15 @@ export default (params: any) => new Promise(async (res, rej) => {
 | 
			
		|||
		const stat = stats.find(s => s.date.getTime() == day.getTime());
 | 
			
		||||
 | 
			
		||||
		if (stat) {
 | 
			
		||||
			chart.push(stat);
 | 
			
		||||
			chart.unshift(stat);
 | 
			
		||||
		} else { // 隙間埋め
 | 
			
		||||
			const mostRecent = stats.find(s => s.date.getTime() < day.getTime());
 | 
			
		||||
			if (mostRecent) {
 | 
			
		||||
				chart.push(Object.assign({}, mostRecent, {
 | 
			
		||||
				chart.unshift(Object.assign({}, mostRecent, {
 | 
			
		||||
					date: day
 | 
			
		||||
				}));
 | 
			
		||||
			} else {
 | 
			
		||||
				chart.push({
 | 
			
		||||
				chart.unshift({
 | 
			
		||||
					date: day,
 | 
			
		||||
					users: {
 | 
			
		||||
						local: {
 | 
			
		||||
| 
						 | 
				
			
			@ -93,5 +93,9 @@ export default (params: any) => new Promise(async (res, rej) => {
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	chart.forEach(x => {
 | 
			
		||||
		delete x.date;
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	res(chart);
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue