Return full date jQuery PHP

Asked

Viewed 28 times

0

Good evening, the idea is to return the full date to be able to search the database correctly.
When I open the page it looks like this: Quando abro a página
When I click the next day it looks like this: Quando clico no dia seguinte

Apparently correct, but need the year also for a more correct search in the comic.
Below the code of how it’s getting:

$(document).ready(function() {
  $(".b").click(function() {
    $(".b").addClass("a");
    $(this).removeClass("a");
    var novothis = $(this);
    $(".vaipa").text($(novothis).text().substring(5, 10));
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<div class="b">
  <?php echo strftime('%a, %d/%m', strtotime('+0 day'));?>
</div>
<div class="a b">
  <?php echo strftime('%a, %d/%m', strtotime('+1 day'));?>
</div>

If anyone has an idea of how to improve, I’d appreciate it!!

  • Add %Y or %y to add year.

  • I only want to have the year in the return given by jQuery, because I only need it to search in the BD, in the buttons above, I do not want to change that format

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.