mirror of
https://github.com/supanadit/short-url.git
synced 2024-11-25 03:46: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;
|
$urlExpired = false;
|
||||||
if ($urlAddress['date_expired'] != null) {
|
if ($urlAddress['date_expired'] != null) {
|
||||||
$today = Carbon::now();
|
$today = Carbon::now()->setTime(0, 0, 0);
|
||||||
$urlExpiredDate = Carbon::parse($urlAddress['date_expired']);
|
$urlExpiredDate = Carbon::parse($urlAddress['date_expired']);
|
||||||
$urlExpired = $urlExpiredDate->lessThan($today);
|
if (!$today->equalTo($urlExpiredDate)) {
|
||||||
|
$urlExpired = $urlExpiredDate->lessThanOrEqualTo($today);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$urlExpired) {
|
if (!$urlExpired) {
|
||||||
|
@ -59,6 +59,17 @@
|
|||||||
<button class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></button>
|
<button class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
|
Loading…
Reference in New Issue
Block a user