2017 © Pedro Peláez
 

library date

Date helpers for citripio websites

image

citripio/date

Date helpers for citripio websites

  • Monday, July 23, 2018
  • by alfredoreduarte
  • Repository
  • 2 Watchers
  • 0 Stars
  • 49 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Date helpers for websites

Installation

Add this to your composer.json, (*1)

{
    "require": {
        "citripio/date": "^1.0"
    }
}

Then:, (*2)

require_once "./vendor/autoload.php";

$date_utils = new Citripio\Date(
    array(
        "lang" => "es",
    )
);

Methods

is_today()

Receives a PHP Date date("Y-m-d H:i:s"). Returns true if it's today., (*3)

is_yesterday()

Receives a PHP Date date("Y-m-d H:i:s"). Returns true if it's yesterday., (*4)

month()

Receives an integer representing a month of the year, returns its name., (*5)

day()

Receives an integer representing a day of the week, returns its name., (*6)

get_date_components()

Useful for composing headings and other strings with dates in them., (*7)

Receives a PHP Date date("Y-m-d H:i:s"). Returns an array containing:, (*8)

  • date_dow: Day name. Same as day()
  • date_day: Day number, like the 20 in "April 20th"
  • date_moy: Month name. Dame as month()
  • date_distance: (today|yesterday|past)
  • ordinal: Date number with an ordinal attached to it, for english dates. Eg: "20th", "3rd", "1st"

The Versions

23/07 2018

dev-master

9999999-dev

Date helpers for citripio websites

  Sources   Download

MIT

by Alfredo Re

20/06 2018

1.0.1

1.0.1.0

Date helpers for citripio websites

  Sources   Download

MIT

by Alfredo Re

20/06 2018

1.0.0

1.0.0.0

Date helpers for citripio websites

  Sources   Download

MIT

by Alfredo Re