Forums

list width dates doesn't appear correctly

dhuizinga1 15 Feb, 2017
In an earlier topic i was searching for php function to dis[play a list width dates started width this day (day(now()).

so i get this function:

<?php
return array(":YEAR(`datum`) >= YEAR(NOW()) && MONTH(`datum`) >= MONTH(NOW()) && DAY(`datum`) >= DAY(NOW())");
?>

But there is something wrong with this code... this displays all date started witd this day... this happens in every month. for example now is day 15 so everhy month start width day 15 and tomorrow width day 16 ... I don't get it and this is for me verry dificult to understand and to explain ..

So I;m looking for the php function that display all the data started width this day
Max_admin 16 Feb, 2017
Hi,

Please give an example of the data range you want to have in the list, today is 16 February 2017, now which dates you want to have available in your list ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dhuizinga1 16 Feb, 2017
Hi Admin,

Here a piece of the list i want to display.. loop what happens after 28 feb.. the next day which appear is today now() in a new month.. this cyclus repeats every montyh.. so a this moment the first 15 days from each month are disapeareds

Datum vanaf t/m Naam Samen met Samen met Opmerking
do, 16 feb '17 19:00 Einde Harrie in 't Veld
vr, 17 feb '17 19:00 Einde Piet Krieger
za, 18 feb '17 08:30 12:30 Astrid Arents Marijke Hunneman
za, 18 feb '17 12:30 15:30 Sabine Harink
za, 18 feb '17 15:30 16:00 Wil Schutte
zo, 19 feb '17 08:30 12:30 Linda Krieger Linda Bosman
zo, 19 feb '17 11:30 15:30 Zorn Hunneman
zo, 19 feb '17 12:30 16:30 Jim v.d. Kolk
zo, 19 feb '17 14:30 Einde Ruud Hegeman Ingeborg Stiekema
zo, 19 feb '17 15:30 18:00 Gerard Hazelhekke keuken
ma, 20 feb '17 19:00 Einde Jeannette van Rossum Ciska Veijer
di, 21 feb '17 19:00 Einde Robert Disselhorst Rein Smith
wo, 22 feb '17 19:00 Einde Jan Krieger
do, 23 feb '17 19:00 Einde Irma Kemper
vr, 24 feb '17 19:00 Einde Peter te Wierik
vr, 24 feb '17 19:00 Einde Gerda Meijerink joclunie carnaval
za, 25 feb '17 08:30 12:30 Frida Kruiper Anja ten Have
za, 25 feb '17 12:30 16:00 Hetty Kruiswijk Wil Schutte?
za, 25 feb '17 19:45 Einde Diana Kemper Annemarie Ruiterkamp carnaval
za, 25 feb '17 19:45 Einde Harrie Kemper Rudi Kruiper carnaval/bandjes
za, 25 feb '17 19:45 11:00 Wil Hauptmeijer Muntverkoop
zo, 26 feb '17 08:30 12:30 Jan ter Horst Hennie Hunneman
zo, 26 feb '17 11:30 Einde Wilhelmien Hauptmeijer
zo, 26 feb '17 12:30 Einde Marcel Meijerink
zo, 26 feb '17 13:30 Einde Diana Kemper Annemarie Ruiterkamp carnaval
zo, 26 feb '17 13:30 Einde Harrie Kemper Rudi Kruiper carnaval
zo, 26 feb '17 13:30 Einde ?????? snoepverkoop carnaval
ma, 27 feb '17 19:00 Einde Rita Lamers Dinie Wunderink
di, 28 feb '17 19:00 Einde André ten Have Bennie Schutte
do, 16 mrt '17 19:00 Einde Harrie in 't Veld
vr, 17 mrt '17 19:00 Einde Piet Krieger
za, 18 mrt '17 08:30 12:30 Astrid Arents Marijke Hunneman
za, 18 mrt '17 12:30 16:00 Marietje Nijkamp Adrie Bloemenkamp
za, 18 mrt '17 16:00 19.30 Wil Schutte
za, 18 mrt '17 19:30 Einde ?????? Robert Disselhorst Handbal
zo, 19 mrt '17 08:30 12:30 Anja Nijland Tonie Linthorst
zo, 19 mrt '17 11:30 Einde Wilhelmien Hauptmeijer
zo, 19 mrt '17 12:30 Einde Ingeborg Stiekema
ma, 20 mrt '17 19:00 Einde Rita Lamers Ciska Veijer
di, 21 mrt '17 19:00 Einde Robert Disselhorst Rein Smith
wo, 22 mrt '17 19:00 Einde Jan Krieger
do, 23 mrt '17 19:00 Einde Irma Kemper
vr, 24 mrt '17 19:00 Einde Peter te Wierik
za, 25 mrt '17 08:30 12:30 Frida Kruiper Anja ten Have
za, 25 mrt '17 12:30 16:00 Dennis Gerritsen Leonie Elsman
zo, 26 mrt '17 08:30 12:30 Linda Krieger Linda Bosman
zo, 26 mrt '17 11:30 15:30 Mart Rensen
zo, 26 mrt '17 12:30 16:30 Wim Beumer
zo, 26 mrt '17 14:30 Einde Marcel Meijerink Angela Kemper
ma, 27 mrt '17 19:00 Einde Gerda Meijerink Irma ten Have
GreyHead 16 Feb, 2017
Answer
Hi dhuizinga1 ,

The code is behaving correctly. You are asking it for records where the year >= 2017 AND the month is >= February AND the day >= 16 (based on today's date).

If the `datum` column is of type date time then this should work
<?php
return array( ": `datum` >= CURDATE()" );
?>

Bob
dhuizinga1 16 Feb, 2017
how is it possible :-)

that's what i mean that this so difficult for me... but i works inderdeed.. and the list is correct and complet

thnx bob
This topic is locked and no more replies can be posted.