Calendar and SPM plugin together date format problem

Topics related to AppGini plugins/add-ons go here.
Post Reply
sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Calendar and SPM plugin together date format problem

Post by sathukorala » 2020-07-08 23:55

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?



sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Re: Calendar and SPM plugin together date format problem

Post by sathukorala » 2020-07-14 05:45

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

Post Reply