From 30b32f21e67116362e1a3edac291de92c61177e6 Mon Sep 17 00:00:00 2001 From: axell-brendow Date: Sun, 7 Mar 2021 14:50:53 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20m=C3=A9todo=20para=20ler=20a=20data?= =?UTF-8?q?=20de=20lan=C3=A7amento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tps/fonte/musica.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tps/fonte/musica.cpp b/tps/fonte/musica.cpp index 82b8ebb..918424b 100644 --- a/tps/fonte/musica.cpp +++ b/tps/fonte/musica.cpp @@ -87,5 +87,12 @@ void read_artists(Musica *music, char *artists_field) { music->num_artists = i; } +void read_release_date(Musica *music, char field[]) { + strcpy(music->release_date, field); + if (strlen(music->release_date) == 4) strcat(music->release_date, "/01/01"); + music->release_date[4] = '/'; + music->release_date[7] = '/'; +} + }