mirror of
				https://github.com/adityatelange/hugo-PaperMod.git
				synced 2025-11-03 18:02:45 +01:00 
			
		
		
		
	cleanup namings
This commit is contained in:
		@@ -4,17 +4,15 @@ function formatDate(date: string | null) {
 | 
				
			|||||||
    year: 'numeric',
 | 
					    year: 'numeric',
 | 
				
			||||||
    month: 'long',
 | 
					    month: 'long',
 | 
				
			||||||
    day: 'numeric',
 | 
					    day: 'numeric',
 | 
				
			||||||
    // hour:'2-digit',
 | 
					 | 
				
			||||||
    // minute: '2-digit',
 | 
					 | 
				
			||||||
  }).format(new Date(date));
 | 
					  }).format(new Date(date));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ('Intl' in window) {
 | 
					if ('Intl' in window) {
 | 
				
			||||||
  window.addEventListener('load', () => {
 | 
					  window.addEventListener('load', () => {
 | 
				
			||||||
    for(const span of [...document.querySelectorAll('.localizable-date')]) {
 | 
					    for(const span of [...document.querySelectorAll('.localizable-date')]) {
 | 
				
			||||||
      var persianDate = formatDate(span.getAttribute('title'));
 | 
					      const localizedDate = formatDate(span.getAttribute('title'));
 | 
				
			||||||
      if (persianDate) {
 | 
					      if (localizedDate) {
 | 
				
			||||||
        span.innerHTML = persianDate;
 | 
					        span.innerHTML = localizedDate;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user