Download the PHP package nickmoline/laravel-stardate without Composer
On this page you can find all versions of the php package nickmoline/laravel-stardate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nickmoline/laravel-stardate
More information about nickmoline/laravel-stardate
Files in nickmoline/laravel-stardate
Download nickmoline/laravel-stardate
More information about nickmoline/laravel-stardate
Files in nickmoline/laravel-stardate
Vendor nickmoline
Package laravel-stardate
Short Description A Laravel package to convert dates to stardates.
License GPL-3.0-or-later
Package laravel-stardate
Short Description A Laravel package to convert dates to stardates.
License GPL-3.0-or-later
Please rate this library. Is it a good library?
Informations about the package laravel-stardate
laravel-stardate
Carbon macros for Laravel Star Trek Date based calculations.
Stardate Calculators
Carbon::actdStardate()
converts carbon dates into pseudo-stardates as used in the ST:ACTD Role playing game and defined in their player's handbookCarbon::tngStardate(int $precision = 1) : string
formats Carbon dates into TNG stardates using the formulareverse engineered by trekguide.com. You can pass an integer in the parenthesis to adjust the decimal precision (default is 1 digit)Carbon::createFromStardate(float|string $stardate) : Carbon
creates a carbon instance from a given stardate (allowing you to convert it back into corresponding earth dates)Carbon::contemporaryStardate(int $precision = 1) : string
formats Carbon dates into TNG stardates using the same formula asCarbon::tngStardate()
but first adds 331 years. This way dates in 1987 appear as if they were in the year 2363 (allowing dates contemporary with TNG era series airing to roughly coincide with the corresponding stardates in the show). Somewhat necessary for dates before 2318 which would calculate to negative stargates.
Star Trek Holidays
Inspired by dansoppelsa/laravel-carbon-macros several functions have been added for Star Trek specific holidays.
- isHolidayName() function returning true if it is a given holiday or not
- nextHolidayName() function returning a
Carbon
date of the next instance of the given holiday after the current date object - lastHolidayName() function returning a
Carbon
date of the previous instance of a given holiday before the current date object - untilHolidayName() function returning a
CarbonInterval
representing the time until the next instance of a given holiday after the current date object. - sinceHolidayName() function returning a
CarbonInterval
representing the time since the last instance of a given holiday before the current date object.
There is also a generic trekHoliday macro that returns the string name of the current holiday if it is a holiday and an isTrekHoliday that returns true if the current date object is any of those holidays.
Current Available Holidays
- First Contact Day: April 5
- Star Trek Day: September 8, the anniversary of the first airing of Star Trek, CBS/Paramount+ often makes a big deal out of this day
- Captain Picard Day: June 16
- Frontier Day: April 14.
- This was tricky, we know it is in April, and that it celebrates the launching of the NX-01. The specific date we get in Broken Bow is April 16, but the launch was at least a day earlier based on the position of that. Startrek.com mentioned it with a post on April 14th, so we went with that date.
- Ancestor's Eve: April 22
Holiday Example
All versions of laravel-stardate with dependencies
PHP Build Version
Package Version
Requires
illuminate/support Version
>=9.0
The package nickmoline/laravel-stardate contains the following files
Loading the files please wait ....