HEX
Server: LiteSpeed
System: Linux sinope.sitehostingserver.com 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
User: aprilnet (1155)
PHP: 8.2.32
Disabled: popen,imap_mail,exec,passthru,system,shell_exec,proc_open,pcntl_exec,eval,allow_url_fopen,allow_url_include,mail,proc_get_status,get_cfg_var,disk_free_space,disk_total_space,diskfreespace,getmygid,getmyinode,getmypid,geymyuid,proc_nice,proc_terminate,proc_close,apache_child_terminate,chown,lchgrp,lchown,link,readlink,highlight_file,show_source,php_strip_whitespace,get_meta_tags,dl,leak,pfsockopen,event_new,pcntl_signal,pcntl_alarm,register_tick_function,apache_setenv,define_syslog_variables,escapeshellarg,escapeshellcmd,ini_alter,ini_restore,inject_code,openlog,syslog,xmlrpc_entity_decode,phpAds_remoteInfo,phpAds_XmlRpc,phpAds_xmlrpcDecode,phpAds_xmlrpcEncode,chgrp,php_eval,safe_dir,root,ftok,egy_perl,symlink,wscript
Upload Files
File: /home/aprilnet/public_html/sciohost.org/wp-content/plugins/meta-box/js/date.js
( function ( $, _, rwmb ) {
	'use strict';

	/**
	 * Transform an input into a date picker.
	 */
	function transform() {
		let $this = $( this ),
			options = $this.data( 'options' );

		let $inline = $this.siblings( '.rwmb-datetime-inline' );
		if ( !$inline.length ) {
			$inline = $this.closest( '.rwmb-input-group' ).siblings( '.rwmb-datetime-inline' );
		}

		let $timestamp = $this.siblings( '.rwmb-datetime-timestamp' ),
			current = $this.val(),
			$picker = $inline.length ? $inline : $this;

		$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text

		options.onSelect = function () {
			$this.trigger( 'change' );
		};
		options.beforeShow = function ( i ) {
			if ( $( i ).prop( 'readonly' ) ) {
				return false;
			}
		};

		if ( $timestamp.length ) {
			options.onClose = options.onSelect = function () {
				$timestamp.val( getTimestamp( $picker.datepicker( 'getDate' ) ) );
				$this.trigger( 'change' );
			};

			$this.on( 'change', () => {
				if ( !$this.val() ) {
					$timestamp.val( '' );
				}
			} );
		}

		if ( !$inline.length ) {
			$this.removeClass( 'hasDatepicker' ).datepicker( options );
			return;
		}

		options.altField = '#' + $this.attr( 'id' );
		$this.on( 'keydown', _.debounce( function () {
			// if val is empty, return to allow empty datepicker input.
			if ( !$this.val() ) {
				return;
			}
			$picker
				.datepicker( 'setDate', $this.val() )
				.find( '.ui-datepicker-current-day' )
				.trigger( 'click' );
		}, 600 ) );

		$inline
			.removeClass( 'hasDatepicker' )
			.empty()
			.prop( 'id', '' )
			.datepicker( options )
			.datepicker( 'setDate', current );
	}

	/**
	 * Convert date to Unix timestamp in milliseconds
	 * @link http://stackoverflow.com/a/14006555/556258
	 * @param date
	 * @return number
	 */
	function getTimestamp( date ) {
		if ( date === null ) {
			return '';
		}
		var milliseconds = Date.UTC( date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() );
		return Math.floor( milliseconds / 1000 );
	}

	function init( e ) {
		/**
		 * WordPress sets localized data for jQuery UI datepicker at document ready.
		 * Using setTimeout to ensure the code runs after the localized data is set.
		 * @link https://wordpress.org/support/topic/inline-date-field-not-localization/
		 */
		setTimeout( () => {
			$( e.target ).find( '.rwmb-date' ).each( transform );
		}, 0 );
	}

	rwmb.$document
		.on( 'mb_ready', init )
		.on( 'clone', '.rwmb-date', transform );
} )( jQuery, _, rwmb );