mirror of
				https://codeberg.org/kbruen/kai.infotren.git
				synced 2025-11-04 00:46:35 +02:00 
			
		
		
		
	Add today indicator to route date chooser
This commit is contained in:
		
							parent
							
								
									0b4d016c50
								
							
						
					
					
						commit
						4214fbbd45
					
				
					 2 changed files with 9 additions and 1 deletions
				
			
		
							
								
								
									
										8
									
								
								route.js
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								route.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -421,6 +421,14 @@ window.addEventListener('load', function (e) {
 | 
			
		|||
            var innerPre = document.createElement('pre')
 | 
			
		||||
            innerP.appendChild(innerPre)
 | 
			
		||||
            innerPre.textContent = `${departureOption.getDate().toString().padStart(2, '0')}.${(departureOption.getMonth() + 1).toString().padStart(2, '0')}.${departureOption.getFullYear().toString().padStart(4, '0')}`
 | 
			
		||||
            var departureOptionMidday = new Date(departureOption.getTime())
 | 
			
		||||
            departureOptionMidday.setHours(12, 0, 0, 0)
 | 
			
		||||
            var todayMidday = new Date()
 | 
			
		||||
            todayMidday.setHours(12, 0, 0, 0)
 | 
			
		||||
            if (departureOptionMidday.getTime() == todayMidday.getTime()) {
 | 
			
		||||
                innerPre.textContent += ' (today)'
 | 
			
		||||
                suggestionLi.focus()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        document.querySelector('.csk').textContent = 'Select'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								sw.js
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								sw.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
const VERSION = 'v35'
 | 
			
		||||
const VERSION = 'v36'
 | 
			
		||||
const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/'
 | 
			
		||||
const API_TRAINS = `${API_ORIGIN}v3/trains`
 | 
			
		||||
const API_STATIONS = `${API_ORIGIN}v3/stations`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue