summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/resources/js/ext.translate.special.translationstats.js
blob: 9440e5f1d412a8cdd93a926c5a709b6ebc1baa95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*!
 * JavaScript functions for embedding jQuery controls
 * into translation notification form.
 *
 * @author Amir E. Aharoni
 * @author Siebrand Mazeland
 * @copyright Copyright © 2012-2013 Amir E. Aharoni, Siebrand Mazeland
 * @license GPL-2.0+
 */

jQuery( document ).ready( function ( $ ) {
	'use strict';

	// Based on UploadWizard, TranslationNotifications
	$( '#start' )
		.datepicker( {
			dateFormat: 'yymmdd',
			constrainInput: false,
			showOn: 'focus',
			changeMonth: true,
			changeYear: true,
			showAnim: false,
			showButtonPanel: true,
			maxDate: new Date(),
			onClose: function ( dateText, inst ) {
				// TranslationStats works with the yyyymmddhhmmss format,
				// so zeros that represents generic hh:mm:ss must be added.
				// The zeros are added only if a date was actually selected
				// and is not currently displayed.
				if ( dateText !== '' && inst.input.val().length < 14 ) {
					inst.input.val( dateText + '000000' );
				}
			}
		} )
		.attr( 'autocomplete', 'off' );
} );