mirror of
https://github.com/supanadit/short-url.git
synced 2024-11-24 11:26:21 +00:00
Fix expired date
This commit is contained in:
parent
d4c089fb22
commit
5da9a2380a
@ -104,9 +104,11 @@ class UrlShortenerController extends Controller
|
||||
|
||||
$urlExpired = false;
|
||||
if ($urlAddress['date_expired'] != null) {
|
||||
$today = Carbon::now();
|
||||
$today = Carbon::now()->setTime(0, 0, 0);
|
||||
$urlExpiredDate = Carbon::parse($urlAddress['date_expired']);
|
||||
$urlExpired = $urlExpiredDate->lessThan($today);
|
||||
if (!$today->equalTo($urlExpiredDate)) {
|
||||
$urlExpired = $urlExpiredDate->lessThanOrEqualTo($today);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$urlExpired) {
|
||||
|
@ -59,6 +59,17 @@
|
||||
<button class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1.</td>
|
||||
<td>http://www.google.com</td>
|
||||
<td>http://shorturl.test/s/fffs</td>
|
||||
<td>5</td>
|
||||
<td><label class="label label-info">Never</label></td>
|
||||
<td><label class="label label-success">Yes</label></td>
|
||||
<td>
|
||||
<button class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
Loading…
Reference in New Issue
Block a user