Skip to content

Commit 5f66600

Browse files
committed
Do not use std::format since it doesn't seem to be available in all CI build environments.
1 parent 2cc0aa6 commit 5f66600

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/eepp/ui/tools/uiaudioplayer.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <eepp/ui/uiprogressbar.hpp>
55
#include <eepp/ui/uiscenenode.hpp>
66

7-
#include <format>
8-
97
namespace EE::UI::Tools {
108

119
static const auto AUDIO_PLAYER_LAYOUT = R"xml(
@@ -74,12 +72,15 @@ static const auto AUDIO_PLAYER_LAYOUT = R"xml(
7472
</hbox>
7573
)xml";
7674

75+
static std::string formatSingleTime( const Time& t ) {
76+
long totalSeconds = static_cast<long>( t.asSeconds() );
77+
long minutes = totalSeconds / 60;
78+
long seconds = totalSeconds % 60;
79+
return String::format( "%ld:%02ld", minutes, seconds );
80+
}
81+
7782
static std::string toTimeString( const Time& t, const Time& t2 ) {
78-
auto formatTime = []( const Time& time ) {
79-
long totalSeconds = static_cast<long>( time.asSeconds() );
80-
return std::format( "{}:{:02}", totalSeconds / 60, totalSeconds % 60 );
81-
};
82-
return std::format( "{} / {}", formatTime( t ), formatTime( t2 ) );
83+
return String::format( "%s / %s", formatSingleTime( t ), formatSingleTime( t2 ) );
8384
}
8485

8586
UIAudioPlayer* UIAudioPlayer::New() {

0 commit comments

Comments
 (0)