Display date intervals

hello. i have a qustion that maybe has a very simple answer but i’m a beginner in working with scripts and i couldn’t find it.

i have this code:

function update_livraredetalii() {
	var dd = $('#livare-data').val();
	dd = Date.fromString(dd);

	var oraazi = new Date().getHours();//0--23
	var ziazi = new Date().getDay();//0--6, 0 dum

	if (dd.getDayOfYear() == today.getDayOfYear() && oraazi >=12) {
	} else {
	dd = dd.asStringFmt('yyyy-mm-dd');
	$('#livraredetalii').val(dd+" "+$('#livare-interval').val());
	today = new Date();today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
	var oraazi = new Date().getHours();//0--23
	var ziazi = new Date().getDay();//0--6, 0 dum

	var msecsInADay = 86400000;
	firstday = today;
	if (ziazi == 0 || (ziazi != 6 && oraazi >= 16) ) { if it's sunday after 4PM
		firstday = new Date(today.getTime()+msecsInADay);
	} else
	if (ziazi == 6 && oraazi >= 10) {//if it's saturday after 10AM
		firstday = new Date(today.getTime()+2*msecsInADay); //next day is monday
	} else 
	if (zonaclasa != 0) {
		firstday = new Date(today.getTime()+msecsInADay);$('#li4').hide();
	} else
	if (oraazi >= 9) { //if it's after 9 PM hide the intervals 1 and 4

	<#if mag.hasText("setup.inchideazi")>
	firstday = new Date(today.getTime()+msecsInADay);
	<#if mag.hasText("setup.inchidemaine")>
	firstday = new Date(today.getTime()+2*msecsInADay);
	Date.format = 'dd-mmm-yyyy';
		renderCallback:function($td,thisDate,month,year) {
			if (thisDate.getDay() == 0 || thisDate.getDayOfYear() < firstday.getDayOfYear()) { //ascundem default toate zilele pana la firstday si duminicile

so i have 5 time intervals but the thing that i couldn’t do is to make that for saturdays to show only the 5th interval and hide the other ones.

i’ve tried adding something like this

if (ziazi == 6) {

but it didn’t work

does anyone have any idea.

Thank you

The first thing I notice from your script is that you have the update_livraredetalii function but this is never called anywhere, if it’s not being executed that’s no wonder it’s not working.

The .show(); and .hide(); syntax you are using is correct, I think this should work if the function is called. If it doesn’t, the fault could be in the selectors (do the elements actually have an id of #li1, #li2 etc?)