Completed
Push — master ( 1c3c2e...248014 )
by Arjay
10:57
created

DateTime   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 4 1
A military() 0 4 1
1
<?php
2
3
namespace Yajra\DataTables\Html\Editor\Fields;
4
5
class DateTime extends Field
6
{
7
    protected $type = 'datetime';
8
9
    /**
10
     * Make a new instance of a field.
11
     *
12
     * @param string $name
13
     * @param string $label
14
     * @return Field|\DateTime
15
     */
16
    public static function make($name, $label = '')
17
    {
18
        return parent::make($name, $label)->format('YYYY-MM-DD hh:mm a');
19
    }
20
21
    /**
22
     * Set format to military time (24 hrs).
23
     *
24
     * @return Field|Time
25
     */
26
    public function military()
27
    {
28
        return $this->format('YYYY-MM-DD HH:mm');
29
    }
30
}
31