jpmurray / laravel-countdown Goto Github PK
View Code? Open in Web Editor NEWProvide an easy class easy way to get the time difference between two dates, with an extra bonus trait for eloquent
License: MIT License
Provide an easy class easy way to get the time difference between two dates, with an extra bonus trait for eloquent
License: MIT License
Method to return formatted string for humans read, maybe like:
$countdown->toHuman(string $custom = null); // 18 years, 33 weeks, 2 days, 18 hours, 4 minutes and 35 seconds
Possibility to pass custom string to parse, like:
$countdown->toHuman('{hours} years, {weeks} weeks, {days} days'); // 18 years, 33 weeks, 2 days
[InvalidArgumentException]
Package jpmurray/laravel-countdown has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version:
- jpmurray/laravel-countdown requires php ^7.0 which does not match your installed version 8.0.8.
- jpmurray/laravel-countdown requires nesbot/carbon ^2.0 but it is not present.
- jpmurray/laravel-countdown requires illuminate/support 6.* || 7.* || 8.* but it is not present.
Halo
I like to try it, but when i try to run, it's show:
(1/1) ErrorException
Non-static method jpmurray\LaravelCountdown\Countdown::from() should not be called statically
Thank you.
Methods elapsed
and until
can receive custom dates or attributes to compare.
elapsed(string $from, $to = null)
Instead of always compare with now, compare with another date or attribute.
$user->elapsed('created_at', 'updated_at');
or
$user->elapsed('created_at', Carbon::now()->subDays(3));
Hi,
How can I show time difference between 2 column?
Explain:
I have discount_date
column in my products table and I want to show countdown between updated_at
and discount_date
.
How do I do that?
PS: I also get
Non-static method jpmurray\LaravelCountdown\Countdown::from() should not be called statically
when i use sample in codes in this package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.