Completed
Pull Request — master (#1662)
by Naveen
01:09
created
src/wordlift/metabox/field/class-wl-metabox-field-date.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -21,63 +21,63 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class Wl_Metabox_Field_Date extends Wl_Metabox_Field {
23 23
 
24
-	/**
25
-	 * Attribute to distinguish between date formats, inferred from the schema property export type
26
-	 *
27
-	 * @since  3.2.0
28
-	 * @access protected
29
-	 * @var string $date_format The date format.
30
-	 */
31
-	protected $date_format;
32
-
33
-	/**
34
-	 * Boolean flag to decide if the calendar should include time or not
35
-	 *
36
-	 * @since  3.2.0
37
-	 * @access protected
38
-	 * @var boolean $timepicker A boolean flag.
39
-	 */
40
-	protected $timepicker;
41
-
42
-	/**
43
-	 * Whether the calendar should be displayed or not.
44
-	 *
45
-	 * @since  3.14.0
46
-	 * @access protected
47
-	 * @var boolean $no_calendar Whether the calendar should be displayed or not.
48
-	 */
49
-	protected $no_calendar;
50
-
51
-	/**
52
-	 * {@inheritdoc}
53
-	 */
54
-	public function __construct( $args, $id, $type ) {
55
-		parent::__construct( $args, $id, $type );
56
-
57
-		$this->no_calendar = false;
58
-
59
-		// Distinguish between date and datetime
60
-		if ( isset( $this->raw_custom_field['export_type'] ) && 'xsd:dateTime' === $this->raw_custom_field['export_type'] ) {
61
-			$this->date_format = 'Y/m/d H:i';
62
-			$this->timepicker  = true;
63
-		} else {
64
-			$this->date_format = 'Y/m/d';
65
-			$this->timepicker  = false;
66
-		}
67
-
68
-	}
69
-
70
-	/**
71
-	 * @param mixed $date
72
-	 *
73
-	 * @return string
74
-	 */
75
-	public function html_input( $date ) {
76
-
77
-		$this->log->debug( "Creating date input with date value $date..." );
78
-
79
-		ob_start();
80
-		?>
24
+    /**
25
+     * Attribute to distinguish between date formats, inferred from the schema property export type
26
+     *
27
+     * @since  3.2.0
28
+     * @access protected
29
+     * @var string $date_format The date format.
30
+     */
31
+    protected $date_format;
32
+
33
+    /**
34
+     * Boolean flag to decide if the calendar should include time or not
35
+     *
36
+     * @since  3.2.0
37
+     * @access protected
38
+     * @var boolean $timepicker A boolean flag.
39
+     */
40
+    protected $timepicker;
41
+
42
+    /**
43
+     * Whether the calendar should be displayed or not.
44
+     *
45
+     * @since  3.14.0
46
+     * @access protected
47
+     * @var boolean $no_calendar Whether the calendar should be displayed or not.
48
+     */
49
+    protected $no_calendar;
50
+
51
+    /**
52
+     * {@inheritdoc}
53
+     */
54
+    public function __construct( $args, $id, $type ) {
55
+        parent::__construct( $args, $id, $type );
56
+
57
+        $this->no_calendar = false;
58
+
59
+        // Distinguish between date and datetime
60
+        if ( isset( $this->raw_custom_field['export_type'] ) && 'xsd:dateTime' === $this->raw_custom_field['export_type'] ) {
61
+            $this->date_format = 'Y/m/d H:i';
62
+            $this->timepicker  = true;
63
+        } else {
64
+            $this->date_format = 'Y/m/d';
65
+            $this->timepicker  = false;
66
+        }
67
+
68
+    }
69
+
70
+    /**
71
+     * @param mixed $date
72
+     *
73
+     * @return string
74
+     */
75
+    public function html_input( $date ) {
76
+
77
+        $this->log->debug( "Creating date input with date value $date..." );
78
+
79
+        ob_start();
80
+        ?>
81 81
 		<div class="wl-input-wrapper">
82 82
 			<input
83 83
 					type="text"
@@ -92,31 +92,31 @@  discard block
 block discarded – undo
92 92
 			</button>
93 93
 		</div>
94 94
 		<?php
95
-		$html = ob_get_clean();
95
+        $html = ob_get_clean();
96 96
 
97
-		return $html;
98
-	}
97
+        return $html;
98
+    }
99 99
 
100
-	public function html_wrapper_close() {
100
+    public function html_wrapper_close() {
101 101
 
102
-		// Should the widget include time picker?
102
+        // Should the widget include time picker?
103 103
 
104
-		// Set up the datetimepicker.
105
-		//
106
-		// See https://github.com/trentrichardson/jQuery-Timepicker-Addon
107
-		// See in http://trentrichardson.com/examples/timepicker.
104
+        // Set up the datetimepicker.
105
+        //
106
+        // See https://github.com/trentrichardson/jQuery-Timepicker-Addon
107
+        // See in http://trentrichardson.com/examples/timepicker.
108 108
 
109
-		$js =
110
-			array(
111
-				'enableTime' => $this->timepicker,
112
-				'noCalendar' => $this->no_calendar,
113
-				'time_24hr'  => true,
114
-				'dateFormat' => $this->date_format,
115
-			);
109
+        $js =
110
+            array(
111
+                'enableTime' => $this->timepicker,
112
+                'noCalendar' => $this->no_calendar,
113
+                'time_24hr'  => true,
114
+                'dateFormat' => $this->date_format,
115
+            );
116 116
 
117 117
         // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
118
-		@ob_start();
119
-		?>
118
+        @ob_start();
119
+        ?>
120 120
 		<script type='text/javascript'>
121 121
 			(function ($) {
122 122
 				$(function () {
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
 			})(jQuery);
126 126
 		</script>
127 127
 		<?php
128
-		$html = ob_get_clean();
128
+        $html = ob_get_clean();
129 129
 
130
-		$html .= parent::html_wrapper_close();
130
+        $html .= parent::html_wrapper_close();
131 131
 
132
-		return $html;
133
-	}
132
+        return $html;
133
+    }
134 134
 
135 135
 }
Please login to merge, or discard this patch.