Jump to content

dsonesuk

Members
  • Posts

    11,220
  • Joined

  • Last visited

  • Days Won

    117

Everything posted by dsonesuk

  1. dsonesuk

    date range

    No! i'm just showing how you will need to convert $datecount to use in the if condition, I don't care which method you use, in BOTH cases you WILL have to convert $datecount to include month and year values, and the format it 'Ymd', because $datecount will only equal a value 1 to 31 at most, while in the if condition startdate and endate will be for example 20120507 and 20120513, if you don't include month and year, it will highlight in all months the week with $datecount value within it
  2. dsonesuk

    date range

    This is the for loop from my original script but from your end its probably changed a lot, so i was reluctant to show it, But! just how you get the correct value of $datecount for the if condition to work. for($date=1;$date<($totaldays_in_mon+$startdate);$date++) { $colcout++; if($colcout ==1) {// <tr> is only added when colcount = 1 meaning fiirst new <td> ie if new column add <tr> before it // Note: $mon and $year should be defined further up unless you changed it then your screwed, and have to change them $convert_datecount = new DateTime($datecount.'-'.$mon.'-'.$year);$convert_datecount = $convert_datecount->modify("tomorrow")->format('Ymd'); //get start and end date of specific date value $newdate$now = new DateTime($newdate);$today=$now;$startDate = $today->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $today->modify("yesterday")->modify("next Sunday")->format('Ymd'); if($convert_datecount>= $startDate && $convert_datecount<= $endDate) { echo '<tr id="current_week">'; } else { echo '<tr>'; } } if($date>=$startdate) { $datecount++; if($colcout==6 || $colcout==7) { $cellclass="weekend"; } else { $cellclass="weekdays"; } ?> <td class="<?php echo $cellclass; ?>" id="<?php echo 'dateid_'.$year.str_pad(date("m", $month), 2 , "0", STR_PAD_LEFT).str_pad($datecount, 2 , "0", STR_PAD_LEFT); ?>"><?php echo $datecount; ?></td> <?php } elseif($colcout==6 || $colcout==7) { ?> IF you wish to change td class, the code is basically the same except for increasing $datecount variable value, as you are dealing with $datacount as it is used to apply the dates, and you need to check against the specific date between and including mon, sunday to highlight (add border) if($date>=$startdate) { $datecount++; if($colcout==6 || $colcout==7) { $cellclass="weekend"; } else { $cellclass="weekdays"; } $convert_datecount = new DateTime($datecount.'-'.$mon.'-'.$year); $convert_datecount = $convert_datecount->format('Ymd'); $today= $today->format('Ymd'); //if datecount ($compare_today) between startdate/enddate and not equal to $newdate value($today) overwrite current class ref and apply highlight cell class instead if($compare_today >= $startday_mon && $compare_today<= $enday_sun && $compare_today != $today) { $cellclass="highlight_weekdays"; } else //else datecount ($compare_today) between startdate/enddate and equal to $newdate value($today) overwrite current class ref and apply highlight cell class and also border class { $cellclass="highlight_weekdays todays_border"; } ?> <td class="<?php echo $cellclass; ?>" id="<?php echo 'dateid_'.$year.str_pad(date("m", $month), 2 , "0", STR_PAD_LEFT).str_pad($datecount, 2 , "0", STR_PAD_LEFT); ?>"><?php echo $datecount; ?></td> <?php } this is not tested i just copied and pasted in original partially copied code. and as i said its probably no resemblance to what you have.
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script type="text/javascript">/*<![CDATA[*//*---->*//*--*//*]]>*/</script><style type="text/css">#wrapper {margin: 0 auto; width: 960px;}.ex1, .ex2, .ex3 { overflow:hidden; margin-bottom: 20px; background-color:#CCFFCC;}.left, .right { width: 200px; background-color:#CCFF00; min-height: 400px; }.left { float: left;}.right {float:right;}.content {background-color:#CCCC00;}.ex1 .content { min-height: 400px;margin-left:210px; }.ex2 .content { min-height: 400px; margin-right: 210px; }.ex3 .content { min-height: 400px;margin: 0 210px;}</style></head><body><div id="wrapper"><div class="ex1"><div class="left">Left</div><div class="content"> Content</div></div><div class="ex2"><div class="right">Right</div><div class="content"> Content</div></div><div class="ex3"><div class="left">Left</div><div class="right">Right</div><div class="content"> Content</div></div></div></body></html>
  4. Everything that should be left, float: left;, Everything that should be right float: right;,
  5. dsonesuk

    date range

    <?php $datecount = 6;$mon = 5; $year = 2012; /// idenify start and end week days using value supplied $newdate="13-05-2012"; $now = new DateTime($newdate); $today=$now; $startDate = $today->modify("tomorrow")->modify("last Monday")->format('Ymd'); $endDate = $today->modify("yesterday")->modify("next Sunday")->format('Ymd'); /// End of idenify start and end week days using value supplied echo 'value of startDate '.$startDate.'<br>';echo 'value of endDate '.$endDate.'<br><br>'; echo ' current value of $datecount as it loops through days '.$datecount.'<br>';echo ' current value of $mon as it loops through months '.$mon.'<br>';echo ' current value of $year as it loops through months '.$year.'<br><br>'; echo 'you are comparing '.$startDate.' and '.$endDate.' with '.$datecount.'<br><br>'; ///convert $datecount$convert_datecount = new DateTime($datecount.'-'.$mon.'-'.$year);$convert_datecount = $convert_datecount->format('Ymd');/// end convert $datecount echo 'correct format of $datecount as $convert_datecount '.$convert_datecount.' but this value will be the LAST days value of last week, as it is yet to be increased for next row, when a new <TR> row is started, So you increase this value to pre-empt this.<br><br>'; ///convert $datecount$convert_datecount = new DateTime($datecount.'-'.$mon.'-'.$year);$convert_datecount = $convert_datecount->modify("tomorrow")->format('Ymd');/// end convert $datecount echo 'correct format of $datecount as $convert_datecount '.$convert_datecount.' with correct date to compare in if condition.<br><br>'; echo 'you are Now comparing '.$startDate.' and '.$endDate.' with '.$convert_datecount.'<br><br>';?>
  6. Position: absolute = fixed left, top positions = fine, if all screens are same size, but! are not! = unhappiness and depressed -> BUT! if had used margins, padding, float instead = centred in all browsers = happiness and contentment.
  7. stop(true,true) makes the animation finish completely, and stops any animation queue so you don't when thumb clicked multiple times, going through the number of queue triggered by clicks, and problem with opacity becoming stuck between opacity 0 to 1. forget about <div id="v_align"> i was experiment to have it vertical aligned, works in FF, opera, no chrome for some reason <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Untitled Document</title><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script><script type="text/javascript">/*<![CDATA[*//*---->*/$(document).ready(function() { $('.thumb_img').click(function() { var n = $(this).attr('src').replace('thumb_', ''); var t = $(this); $('body').append('<div class="pic_preview"></div>'); $('.pic_preview').fadeTo('slow', 0.9); $('body').append('<div id="v_align"><img id="pic_src" src="'+n+'"></div>'); $(".thumb_img").each(function() { $(this).clone().removeClass("thumb_img").addClass("thumb").appendTo('#v_align'); }); //$('body').append('<img id="pic_src" src="'+n+'">'); $("#pic_src").hide(); $('#pic_src').css('margin-top', '-'+parseInt(($("#pic_src").height()/2))+'px'); $('#pic_src').stop(true,true).fadeIn('slow').css('visibility', 'visible'); $('.thumb').click(function() { $("#pic_src").attr('src', $(this).attr('src').replace('thumb_', '')) $("#pic_src").hide(); $('#pic_src').stop(true,true).fadeIn('slow').css('visibility', 'visible'); }); }); $(document).keyup(function(e) { if (e.which == 27) { // ESC key $('#pic_src').fadeOut('fast', function() { $(this).fadeOut('fast', function() { $(this).remove(); $("#v_align").remove(); }); $('.pic_preview').fadeTo('fast', 1.0).fadeOut('slow', function() { $(this).remove(); }); }); } }); });function showthis(n) { }/*--*//*]]>*/</script><style type="text/css">body, html {height: 100%;}#pic_src { visibility:hidden;}.pic_preview { position:absolute; top:0; left:0; right:0; bottom:0; background-color:#000; z-index:1000;}#v_align { position:absolute; top:0; left:0; right:0; bottom:0; vertical-align:middle; text-align:center;z-index:1000;}#pic_src {position:relative; z-index:1055; top: 50%; bottom:50%;}</style></head><body><img src="../ovtesting/tabmenu/thumb_imgview1.jpg" width="106" height="64" class="thumb_img"><img src="../ovtesting/tabmenu/thumb_imgview2.jpg" width="106" height="64" class="thumb_img"><img src="../ovtesting/tabmenu/thumb_imgview3.jpg" width="106" height="64" class="thumb_img"></body></html>
  8. Argh...so basically a lightbox image pop-up, see how easy it becomes when you explain what this is, and what this does. For fadein and fadeout to work display none; is required, and hide() reproduces this, I can't get the fadeIn on the first image click to work with your first script in firefox at all, but in chrome, safari it does reproduce your problem, I think it works first time because the image has not been loaded before and is sort of given the same result as using display: none, the second time the image is stored in cache so it appears instantly. So by just adding $("#pic_src").hide(); after image is appended sets as display none and it works in all browsers as it should. Edit: also consider using $(document).keyup(function(e) instead, as there seems to be a problem in FF when using $('body').
  9. I don't know? what is the purpose of the pic_preview? to preview what? you have thumbnails, where are these placed, are these supposed to go in the preview?, what is the purpose of the 0.9 fade? if you remove it as i suggested that problem goes away as it is only the image that fades in and out. Input, Input need input
  10. The problem is everytime you click a thumbnail a new '.pic_preview' div is created AND image with identical id reference is created also, and shouldn't the image be inside the '.pic_preview' I think you are looking for this if i have read this correctly $('.thumb_img').click(function() { var n = $(this).attr('src').replace('thumb_', ''); $('.pic_preview').remove(); // prevent duplicate.pic_preview and img with pic_src $('body').append('<div class="pic_preview"></div>'); $('.pic_preview').append('<img id="pic_src" src="'+n+'">'); // append image in div not body $("#pic_src").hide(); // hide image $('.pic_preview').fadeTo('slow', 0.9); $('#pic_src').fadeIn('slow').css('visibility', 'visible');}); with $('.pic_preview').fadeTo('slow', 0.9); it shudders from one effect to another, so i suggest removing this completely
  11. ??? I honestly can't figure out what you are trying to describe here? I think you mean this kind of layout .iso{background:url(http://static.mikroviologos.eu/image/hktheme/sprites2.png) 0 10px no-repeat; height: 30px; line-height:30px; padding-left: 30px; margin: 0.5em 0;} <div><h5 class="iso">Title text</h5><p>text text</p><p>text text</p><p>text text</p><p>text text</p><p>text text</p></div>
  12. Not! necccesssssarillllly .iso{background:url(http://static.mikroviologos.eu/image/hktheme/sprites2.png) 0 10px no-repeat; height: 30px; line-height:30px; padding-left: 30px;float: left;} <p class="iso">text text</p>
  13. Sprite image won't work for image as its used as background, and you are not supposed to use background-image on img element, but it can be used for anchor element.
  14. When the ajax places the new content into the required div, reapply the reinitialization of the prettyphoto function if (xmlhttp.readyState==4 && xmlhttp.status==200) {document.getElementById(targetDiv).innerHTML=xmlhttp.responseText;$("a[rel^=prettyPhoto]").prettyPhoto();}
  15. dsonesuk

    date range

    Yes you have to use $datecount, but because the value will be the previous days value you would increase it by 1, which will make it fall between $startDate and $endDate, and don't forget you have to compare it not by just the day, but month and year also in format of "Ymd", then echo the tr element with id.
  16. How are you creating html documents, Notepad? are you saving using encoding UTF-8? also try <img src="file:///C|/Users/Len0/Documents/HTML%20Tutorials/goose.bmp" alt="This is a bmp picture" />
  17. normally jquery is written as $(document).ready(function(){ }); but sometimes using $, causes a conflict with other scripts (mootools is one), so jQuery.noConflict(); was created, you now replace $ with jQuery jQuery.noConflict(); jQuery(document).ready(function(){ }); if you use without first declaring 'jQuery.noConflict();' it does not recognise it as being used in place of '$' and it gives a undefined error.
  18. make backup of html and css, replace original html with below <div id="menu-bar"> <ul> <li><a href="http://www.roxannedavisphotography.com">Home</a></li> <li><a href="#">Portfolio</a> <ul> <li><a href="#">Bands</a> <ul> <li><a href="http://www.roxannedavisphotography.com/DespairsRay.html">D'espairsRay</a></li> <li><a href="http://www.roxannedavisphotography.com/Versailles.html">Versailles</a></li> <li><a href="http://www.roxannedavisphotography.com/Queensryche.html">Queensrÿche</a></li> <li><a href="http://www.roxannedavisphotography.com/Love_Said_No.html">Love Said No</a></li> <li><a href="http://www.roxannedavisphotography.com/Soundevice.html">Soundevice</a></li> </ul> </li> <li><a href="http://www.roxannedavisphotography.com/seniors.html">Seniors</a></li> <li><a href="http://www.roxannedavisphotography.com/wedding.html">Wedding</a></li> <li><a href="http://www.roxannedavisphotography.com/people_portraits.html">People & Portraits</a></li> <li><a href="http://www.roxannedavisphotography.com/pets.html">Pets</a></li> <li><a href="http://www.roxannedavisphotography.com/commercial.html">Commercial</a></li> <li><a href="http://www.roxannedavisphotography.com/graphics.html">Graphics</a></li> </ul> </li> <li><a href="#">Fine Art Prints</a> <ul> <li><a href="#">Scenic</a></li> <li><a href="#">Wildlife</a></li> <li><a href="#">Nature</a></li> <li><a href="#">Miscellaneous</a></li> </ul></li><li><a href="#">Price Lists</a> <ul> <li><a href="http://www.roxannedavisphotography.com/price_list.html">Session & Prints Price List</a></li> <li><a href="http://www.roxannedavisphotography.com/wedding_price_list.html">Wedding Price List</a></li> </ul> </li> <li><a href="http://roxannedavis.zenfolio.com/">Customer Order Page</a></li> <li><a href="http://www.roxannedavisphotography.com/profile.html">About the Owner</a></li> <li><a href="http://www.roxannedavisphotography.com/contact.html">Contact Me</a></li> </ul></div> replace original css with body{ padding:0px; background: #000000; font-size: 12px; color: white; font-family: 'Pontano Sans', sans-serif; } #menu-bar, #menu-bar ul, #menu-bar li{font-family: 'Pontano Sans', sans-serif; font-size:18px; text-indent:0; padding:0; margin:0; } #menu-bar li{ white-space:nowrap; list-style: none; position: relative; float: left; /* this makes the lists to appear horizontally */ height: 50px; text-align: center; background-color: #000000; line-height: 50px; padding: 0 22px 5px; padding-bottom:5px; } #menu-bar li:last-child {padding:0; } #menu-bar li li, #menu-bar li li:last-child{ width:100%; text-align: left; padding-left:25px; padding-right:0px; } #menu-bar li a{ display:block; /*added by dsonesuk */ text-decoration:none; color: white; } #menu-bar li:hover{ background-color:#000000; } #menu-bar ul ul{ position:absolute; /*added by dsonesuk */ width:225px; /*added by dsonesuk */ top:50px;/*amended by dsonesuk */ /*visibility:hidden;*/ /*background-image:/graphics/menu_background.jpg;*/ } #menu-bar ul li:hover ul{ visibility:visible; background-color:#CC9999; } #menu-bar ul ul ul{ top:0px;} /*reset positon for all sublevels below sublevel 1*/ #menu-bar ul ul li a {display:block; width:100%; height:100%; line-height:50px; float:none; } /*for every new sublevel add preffix ul (ul li:hover li ul = sublevel 1, ul ul li.hover li ul= sublevel 2 and so on. the .sfhover is for ie6 which should be identical to prev example but with replacment of ':hover' with '.sfhover' instead )*/#menu-bar ul ul,#menu-bar ul li:hover li ul, /*sublevel 1*/#menu-bar ul ul li:hover li ul /*sublevel 2*/{left:-999999em;} /*xxxxxxxxxxxxx set hover xxxxxxxxxxxxx*/#menu-bar ul li:hover,#menu-bar ul li ul{z-index:99;} /*prevents overlap from neighbouring images and borders*/ #menu-bar ul li:hover, #menu-bar ul ul li a:hover, #menu-bar ul ul li:hover {background-color:#333;} /*for every new sublevel add prefix ul (ul li:hover ul = sublevel 1, ul ul li:hover ul= sublevel 2 and so on. the .sfhover is for ie6 which should be identical to prev example but with replacment of ':hover' with '.sfhover' instead, THESE MUST BE DONE SEPARATE as below and not grouped together )*/ /*sublevel 1*/#menu-bar ul li:hover ul{left:0px;} /*sublevel 2*/ #menu-bar ul ul li:hover ul {left:0;margin-left: 250px;} /*sublevel 3*/#menu-bar ul ul ul li:hover ul {left:0;margin-left: 250px;} Here ends the difficult, copy and paste lesson for today.
  19. You can get same result using unordered list element, with position: absolute elements <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script type="text/javascript">/*<![CDATA[*//*---->*//*--*//*]]>*/</script> <style type="text/css">ul,li {margin:0; padding:0; text-indent: 0; list-style-type:none;}#outer {height: 500px;width: 600px;margin-right: auto;margin-left: auto;position:relative;}.parent {height: 500px;width: 600px;border: 1px solid #F00;position:relative;}.elder-sibling {background-color: #000;height: 200px;width: 200px;position: absolute;color: #FFF;top:0;left:0;}.younger-sibling {background-color: #00F;height: 100px;width: 100px;position: absolute;top: 250px;color: #FFF;z-index:20;}#b2 {top:0; left:0; width:200px; height:200px; z-index:30;}#b1 {top:0; left:0; width:100%; height:100%; z-index:10;}ul li b { display:block; height:100%; width: 100%; position:absolute; z-index:0;}ul li li b { height:100%; width: 100%;}ul li li li b { height:100%; width: 100%;}ul.younger-sibling li, ul.elder-sibling li{height: 100%; width:100%; z-index:0;}#b1:hover + b {background-color:#FFFFFF;}#b2:hover + b { background-color:#FFFFFF;}ul li:hover{background-color:yellow;}ul li li:hover{background-color:red;}ul li li b:hover{background-color:#000;}ul li li li b:hover{background-color: blue;}</style></head><body><ul id="outer"><li class="parent"><b id="b1"> </b><b> </b><b id="b2"> </b><b> </b> <ul class="elder-sibling"> <li><b>elder-sibling</b> <ul class="younger-sibling"> <li><b>younger-sibling</b></li> </ul> </li> </ul></li></ul></body></html>
  20. At present there's no way to target preceding sibling elements OR parent element in CSS, for a succeeding sibling element yes! with '+' or '~', this could be achieved using JavaScript/Jquery though.
  21. You Have major validation errors, misplaced <center> and </center> tags, which should be corrected body{ padding:0px; background: #000000; font-size: 12px; color: white; font-family: 'Pontano Sans', sans-serif; } #menu-bar, #menu-bar ul, #menu-bar li{font-family: 'Pontano Sans', sans-serif; font-size:18px; text-indent:0; padding:0; margin:0; } #menu-bar li{ white-space:nowrap; list-style: none; position: relative; float: left; /* this makes the lists to appear horizontally */ height: 50px; text-align: center; background-color: #000000; line-height: 50px; padding: 0 22px 5px; padding-bottom:5px; } #menu-bar li:last-child {padding:0; } #menu-bar li li, #menu-bar li li:last-child{ width:100%; text-align: left; padding-left:25px; padding-right:0px; } #menu-bar li a{ display:block; /*added by dsonesuk */ text-decoration:none; color: white; } #menu-bar li:hover{ background-color:#000000; } #menu-bar ul ul{ position:absolute; /*added by dsonesuk */ width:225px; /*added by dsonesuk */ top:50px;/*amended by dsonesuk */ /*visibility:hidden;*/ /*background-image:/graphics/menu_background.jpg;*/ } #menu-bar ul li:hover ul{ visibility:visible; background-color:#CC9999; } #menu-bar ul ul ul{ top:0px;} /*reset positon for all sublevels below sublevel 1*/ #menu-bar ul ul li a {display:block; width:100%; height:100%; line-height:50px; float:none; } /*for every new sublevel add preffix ul (ul li:hover li ul = sublevel 1, ul ul li.hover li ul= sublevel 2 and so on. the .sfhover is for ie6 which should be identical to prev example but with replacment of ':hover' with '.sfhover' instead )*/#menu-bar ul ul,#menu-bar ul li:hover li ul, /*sublevel 1*/#menu-bar ul ul li:hover li ul /*sublevel 2*/{left:-999999em;} /*xxxxxxxxxxxxx set hover xxxxxxxxxxxxx*/#menu-bar ul li:hover,#menu-bar ul li ul{z-index:99;} /*prevents overlap from neighbouring images and borders*/ #menu-bar ul li:hover, #menu-bar ul ul li a:hover, #menu-bar ul ul li:hover {background-color:#333;} /*for every new sublevel add prefix ul (ul li:hover ul = sublevel 1, ul ul li:hover ul= sublevel 2 and so on. the .sfhover is for ie6 which should be identical to prev example but with replacment of ':hover' with '.sfhover' instead, THESE MUST BE DONE SEPARATE as below and not grouped together )*/ /*sublevel 1*/#menu-bar ul li:hover ul{left:0px;} /*sublevel 2*/ #menu-bar ul ul li:hover ul {left:0;margin-left: 250px;} /*sublevel 3*/#menu-bar ul ul ul li:hover ul {left:0;margin-left: 250px;}
  22. dsonesuk

    date range

    $now = new DateTime($newdate);$today=$now->format('j m Y');$startDate = $mondayweek->modify("tomorrow")->modify("last Monday")->format('j m Y');$endDate = $mondayweek->modify("yesterday")->modify("next Sunday")->format('j m Y'); now() is the date you want to identify the startdate and enddate (monday to sunday), $today is the date but in specific format, therefore in the if condition using $today as it is if($today>= $startDate && $today <= $endDate) will always be true! hence repeated id ref, you need the variable applied to td cell increase by 1, and compare this variable value in the 'if' condition
  23. dsonesuk

    date range

    Err, sorry i have to disagree, its the php that assigns the id ref depending on the result of the if condition. try adding $today, $endDate to temp class to identify what it is checking against {echo '<tr id="current_week" class="td_'.$today.' sd_'.$startDate.' ed_'.$endDate.'">';}$today can't be a static date, it must the date applied within the td cells themselves, because yes, it will show repeated id ref , because yes the static date IS always between start and end dates.
  24. dsonesuk

    date range

    what is $monday referring to? if $now is the date you are checking against, surly you would want to check against the monday (start date) and sunday (end date) that it falls between. $now = new DateTime($newdate);$today=$now->format('Ymd'); $monday = clone $now;$sunday = clone $now;$startDate = $monday->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $sunday->modify("yesterday")->modify("next Sunday")->format('Ymd'); EDIT: its the way i formatted the dates ('Ymd') produces 20120503 which is a better value to do calculations against, than ('j m Y') 3 05 2012 or ('Ymj') 2012053 as theres no leading zeroes for last digitYmjMonday = 20120430 = 20,120,430Sunday = 2012056 = 2,012,056current = 2012053 = 2,012,053 compared toYmdMonday = 20120430 = 20,120,430Sunday = 20120506 = 20,120,506current = 20120503 = 20,120,503
  25. dsonesuk

    date range

    Because, $monday= setdate, if this day is on Sunday, goes FORWARD 1 day, now you are in Monday, therefore 'this Monday' would target that Monday (next weeks Monday), whereas 'last Monday' brings you back the 'Monday' of the current week you are working to. Hope that makes sense! unless you mean? why not$startDate = $monday->modify("tomorrow");$startDate = $startDate->modify("last Monday");$startDate = $startDate->format('Ymd');$endDate = $sunday->modify("yesterday");$endDate = $endDate->modify("next Sunday");$endDate = $endDate->format('Ymd');instead$startDate = $monday->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $sunday->modify("yesterday")->modify("next Sunday")->format('Ymd');lot shorter
×
×
  • Create New...