@@ -172,15 +172,6 @@ function initBackwardsCopyTemplateRowPage() {
172
172
} ` :
173
173
this . backwardsCopyTemplateRow . year
174
174
) ;
175
- const parsedDate =
176
- ( rowDate == null || rowDate . trim ( ) . length === 0 ) ?
177
- undefined : (
178
- ! isNaN ( new Date ( rowDate . trim ( ) + ' UTC' ) . getTime ( ) ) ?
179
- ( new Date ( rowDate . trim ( ) + ' UTC' ) ) : (
180
- ! isNaN ( new Date ( rowDate . trim ( ) ) . getTime ( ) ) ?
181
- new Date ( rowDate . trim ( ) ) : null
182
- )
183
- ) ;
184
175
185
176
// TODO: l10n
186
177
const authorRegex = / ( .+ ?, (?: [ A - Z ] \. \s ? ) * ) (?: (?: & a m p ; | [ & ; ] | [ , ; ] (?: & a m p ; | [ & ; ] ) ? ) \s * | $ ) / g;
@@ -199,13 +190,11 @@ function initBackwardsCopyTemplateRowPage() {
199
190
value : this . backwardsCopyTemplateRow . title ??
200
191
this . backwardsCopyTemplateRow . articlename
201
192
} ) ,
202
- date : new mw . widgets . datetime . DateTimeInputWidget ( {
203
- $overlay : this . parent . $overlay ,
204
- required : true ,
205
- calendar : null ,
206
- icon : 'calendar' ,
207
- clearable : true ,
208
- value : parsedDate
193
+ date : new OO . ui . TextInputWidget ( {
194
+ placeholder : mw . message (
195
+ 'deputy.ante.backwardsCopy.entry.date.placeholder'
196
+ ) . text ( ) ,
197
+ value : rowDate
209
198
} ) ,
210
199
author : new OO . ui . TagMultiselectWidget ( {
211
200
allowArbitrary : true ,
@@ -294,17 +283,7 @@ function initBackwardsCopyTemplateRowPage() {
294
283
} else {
295
284
// Attach the change listener
296
285
input . on ( 'change' , ( value : string ) => {
297
- if ( input instanceof mw . widgets . datetime . DateTimeInputWidget ) {
298
- this . backwardsCopyTemplateRow [ field ] =
299
- new Date ( value ) . toLocaleDateString ( 'en-GB' , {
300
- year : 'numeric' , month : 'long' , day : 'numeric'
301
- } ) ;
302
- if ( value . length > 0 ) {
303
- fields [ field ] . setWarnings ( [ ] ) ;
304
- }
305
- } else {
306
- this . backwardsCopyTemplateRow [ field ] = value ;
307
- }
286
+ this . backwardsCopyTemplateRow [ field ] = value ;
308
287
this . backwardsCopyTemplateRow . parent . save ( ) ;
309
288
} ) ;
310
289
}
0 commit comments