This commit is contained in:
		
							parent
							
								
									5f4a1ccac7
								
							
						
					
					
						commit
						544f8ad54f
					
				
							
								
								
									
										10
									
								
								server.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								server.js
									
									
									
									
									
								
							@ -72,6 +72,16 @@ app.get('/', function(req, res){
 | 
				
			|||||||
            console.log(err);
 | 
					            console.log(err);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            //console.log(rows);
 | 
					            //console.log(rows);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Loop over elements in rows array, convert ugly UTC times to pretty local times.
 | 
				
			||||||
 | 
					            rows.forEach(function(row){
 | 
				
			||||||
 | 
					                var localDtTm = moment.utc(new Date(row.MaxPub));
 | 
				
			||||||
 | 
					                localDtTm = moment(localDtTm).tz('America/New_York').format('MM-DD-YYYY HH:mm:ss');
 | 
				
			||||||
 | 
					                row.MaxPub = localDtTm;
 | 
				
			||||||
 | 
					                row.MaxPubDate = moment(localDtTm).format('MM-DD-YYYY');
 | 
				
			||||||
 | 
					                row.MaxPubTime = moment(localDtTm).format('h:mm:ss a');
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            res.render('index', {cores: rows}, function(err, html) {
 | 
					            res.render('index', {cores: rows}, function(err, html) {
 | 
				
			||||||
                if(err !== null) {
 | 
					                if(err !== null) {
 | 
				
			||||||
                    console.log(err);
 | 
					                    console.log(err);
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@
 | 
				
			|||||||
            <th>Location</th>
 | 
					            <th>Location</th>
 | 
				
			||||||
            <th>Last Update</th>
 | 
					            <th>Last Update</th>
 | 
				
			||||||
            <th></th>
 | 
					            <th></th>
 | 
				
			||||||
 | 
					            <th></th>
 | 
				
			||||||
        </tr>
 | 
					        </tr>
 | 
				
			||||||
    </thead>
 | 
					    </thead>
 | 
				
			||||||
    <tbody>
 | 
					    <tbody>
 | 
				
			||||||
@ -33,7 +34,8 @@
 | 
				
			|||||||
                        <a href="https://particle.kaplon.us/core/edit/{{this.coreId}}" class="btn btn-primary">Edit Details</a>
 | 
					                        <a href="https://particle.kaplon.us/core/edit/{{this.coreId}}" class="btn btn-primary">Edit Details</a>
 | 
				
			||||||
                    {{/if}}
 | 
					                    {{/if}}
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td>{{this.MaxPub}}</td>
 | 
					                <td>{{this.MaxPubDate}}</td>
 | 
				
			||||||
 | 
					                <td>{{this.MaxPubTime}}</td>
 | 
				
			||||||
                <td>{{this.MaxStatus}}</td>
 | 
					                <td>{{this.MaxStatus}}</td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
        {{/each}}
 | 
					        {{/each}}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user