Page 1 of 1

Calendar and SPM plugin together date format problem

Posted: 2020-07-08 23:55
by sathukorala
When these two plugins are been used together the date format becomes a problem.
Calendar plugin doesn't support YYYY-MM-DD HH:MM:SS format (like 2020-07-01 05:54:00) but the SPM plugin uses YYYY-MM-DD HH:MM:SS format

Is there a way to change SPM date time format to other formats like YYYY/MM/DD HH:MM:SS format?
Or is there a way around to avoid this hassle?

Re: Calendar and SPM plugin together date format problem

Posted: 2020-07-10 03:10
by sathukorala
Can anyone please suggest a solution?

Re: Calendar and SPM plugin together date format problem

Posted: 2020-07-14 02:11
by sathukorala
Any ideas?

Re: Calendar and SPM plugin together date format problem

Posted: 2020-07-14 05:45
by sathukorala
Found a workaround

After installing the SPM plugin:
goto hooks > TABLE_NAME_filter.php file:

Edit following with format: 'YYYY/MM/DD HH:mm:ss (or any other format you prefer):

Code: Select all

<script>
		$j(function(){
			//date
			$j("#from-date_2 , #to-date_2 ").datetimepicker({
				format: 'YYYY/MM/DD HH:mm:ss'   //config
			});

			$j("#from-date_2" ).on('dp.change' , function(e){
				date = moment(e.date).add(1, 'month');  
				$j("#to-date_2 ").val(date.format('YYYY/MM/DD HH:mm:ss')).data("DateTimePicker").minDate(e.date);
			});
		});
	</script>

That format will work with both Calendar plugin and SPM together