mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	Use HH date library when not using MSVC
This commit is contained in:
		
							parent
							
								
									e78dc9b3db
								
							
						
					
					
						commit
						593010acc2
					
				
					 10 changed files with 98 additions and 14 deletions
				
			
		|  | @ -30,6 +30,10 @@ | |||
| #include <QStandardPaths> | ||||
| #include <QToolButton> | ||||
| 
 | ||||
| #if !defined(_MSC_VER) | ||||
| #   include <date/date.h> | ||||
| #endif | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -407,8 +411,14 @@ void MainWindow::on_resourceTreeView_doubleClicked(const QModelIndex& index) | |||
| 
 | ||||
|    static const std::string timeFormat {"%Y-%m-%d %H:%M:%S"}; | ||||
| 
 | ||||
|    using namespace std::chrono; | ||||
| 
 | ||||
| #if !defined(_MSC_VER) | ||||
|    using namespace date; | ||||
| #endif | ||||
| 
 | ||||
|    std::istringstream in {selectedString}; | ||||
|    in >> std::chrono::parse(timeFormat, time); | ||||
|    in >> parse(timeFormat, time); | ||||
| 
 | ||||
|    if (in.fail()) | ||||
|    { | ||||
|  |  | |||
|  | @ -22,6 +22,10 @@ | |||
| #include <imgui.h> | ||||
| #include <mbgl/util/constants.hpp> | ||||
| 
 | ||||
| #if !defined(_MSC_VER) | ||||
| #   include <date/date.h> | ||||
| #endif | ||||
| 
 | ||||
| #if defined(_MSC_VER) | ||||
| #   pragma warning(pop) | ||||
| #endif | ||||
|  | @ -95,8 +99,16 @@ void OverlayLayer::Render( | |||
| 
 | ||||
|    if (p->sweepTimeNeedsUpdate_ && radarProductView != nullptr) | ||||
|    { | ||||
|       const scwx::util::time_zone* currentZone; | ||||
| 
 | ||||
| #if defined(_MSC_VER) | ||||
|       currentZone = std::chrono::current_zone(); | ||||
| #else | ||||
|       currentZone = date::current_zone(); | ||||
| #endif | ||||
| 
 | ||||
|       p->sweepTimeString_ = scwx::util::TimeString( | ||||
|          radarProductView->sweep_time(), std::chrono::current_zone(), false); | ||||
|          radarProductView->sweep_time(), currentZone, false); | ||||
|       p->sweepTimeNeedsUpdate_ = false; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat