@@ -25,7 +25,9 @@ import p5 from '../core/main';
25
25
* Current day is displayed
26
26
*
27
27
*/
28
- p5 . prototype . day = ( ) => new Date ( ) . getDate ( ) ;
28
+ p5 . prototype . day = function ( ) {
29
+ return new Date ( ) . getDate ( ) ;
30
+ } ;
29
31
30
32
/**
31
33
* p5.js communicates with the clock on your computer. The <a href="#/p5/hour">hour()</a> function
@@ -45,7 +47,9 @@ p5.prototype.day = () => new Date().getDate();
45
47
* Current hour is displayed
46
48
*
47
49
*/
48
- p5 . prototype . hour = ( ) => new Date ( ) . getHours ( ) ;
50
+ p5 . prototype . hour = function ( ) {
51
+ return new Date ( ) . getHours ( ) ;
52
+ } ;
49
53
50
54
/**
51
55
* p5.js communicates with the clock on your computer. The <a href="#/p5/minute">minute()</a> function
@@ -65,7 +69,9 @@ p5.prototype.hour = () => new Date().getHours();
65
69
* Current minute is displayed
66
70
*
67
71
*/
68
- p5 . prototype . minute = ( ) => new Date ( ) . getMinutes ( ) ;
72
+ p5 . prototype . minute = function ( ) {
73
+ return new Date ( ) . getMinutes ( ) ;
74
+ } ;
69
75
70
76
/**
71
77
* Returns the number of milliseconds (thousandths of a second) since
@@ -108,9 +114,10 @@ p5.prototype.millis = function() {
108
114
* Current month is displayed
109
115
*
110
116
*/
111
- p5 . prototype . month = ( ) =>
117
+ p5 . prototype . month = function ( ) {
112
118
//January is 0!
113
- new Date ( ) . getMonth ( ) + 1 ;
119
+ return new Date ( ) . getMonth ( ) + 1 ;
120
+ } ;
114
121
115
122
/**
116
123
* p5.js communicates with the clock on your computer. The <a href="#/p5/second">second()</a> function
@@ -130,7 +137,9 @@ p5.prototype.month = () =>
130
137
* Current second is displayed
131
138
*
132
139
*/
133
- p5 . prototype . second = ( ) => new Date ( ) . getSeconds ( ) ;
140
+ p5 . prototype . second = function ( ) {
141
+ return new Date ( ) . getSeconds ( ) ;
142
+ } ;
134
143
135
144
/**
136
145
* p5.js communicates with the clock on your computer. The <a href="#/p5/year">year()</a> function
@@ -150,6 +159,8 @@ p5.prototype.second = () => new Date().getSeconds();
150
159
* Current year is displayed
151
160
*
152
161
*/
153
- p5 . prototype . year = ( ) => new Date ( ) . getFullYear ( ) ;
162
+ p5 . prototype . year = function ( ) {
163
+ return new Date ( ) . getFullYear ( ) ;
164
+ } ;
154
165
155
166
export default p5 ;
0 commit comments