Alles zusammengefasst

Hier aber nochmal der komplette Code zum einfacheren heraus kopieren (wir wissen doch alle, wie das immer so ist – ich verweise trotzdem gerne nochmal auf meine Kaffeekasse)


<style>
	.CalenderContainer
	{
		padding: 0;
	    outline: 0;
	    text-align: left;
	    width: 307.875px;
	    min-width: 307.875px;
	    max-width: 307.875px;
	    -webkit-box-sizing: border-box;
	    box-sizing: border-box;
	    display: inline-block;
	    display: -ms-flexbox;
	    display: -webkit-box;
	    display: -webkit-flex;
	    display: flex;
	    -webkit-flex-wrap: wrap;
	    flex-wrap: wrap;
	    -ms-flex-wrap: wrap;
	    -ms-flex-pack: justify;
	    -webkit-justify-content: space-around;
	    justify-content: space-around;
	    -webkit-transform: translateZ(0);
	    transform: translateZ(0);
	    opacity: 1;
	    margin: 0 auto;
	}
	.DayContainer
	{
		background: none;
	    border: 1px solid transparent;
	    border-radius: 150px;
	    -webkit-box-sizing: border-box;
	    box-sizing: border-box;
	    color: #ccc;
	    font-weight: 400;
	    width: 14.2857143%;
	    -webkit-flex-basis: 14.2857143%;
	    -ms-flex-preferred-size: 14.2857143%;
	    flex-basis: 14.2857143%;
	    max-width: 39px;
	    height: 39px;
	    line-height: 39px;
	    margin: 5px 0px;
	    display: inline-block;
	    position: relative;
	    -webkit-box-pack: center;
	    -webkit-justify-content: center;
	    -ms-flex-pack: center;
	    justify-content: center;
	    text-align: center;
	}
	.WeekdayContainer
	{
		background: none;
	    border: 1px solid transparent;
	    border-radius: 150px;
	    -webkit-box-sizing: border-box;
	    box-sizing: border-box;
	    color: #000;
	    font-weight: 400;
	    width: 14.2857143%;
	    -webkit-flex-basis: 14.2857143%;
	    -ms-flex-preferred-size: 14.2857143%;
	    flex-basis: 14.2857143%;
	    max-width: 39px;
	    height: 20px;
	    line-height: 39px;
	    margin: 5px 0px;
	    display: inline-block;
	    position: relative;
	    -webkit-box-pack: center;
	    -webkit-justify-content: center;
	    -ms-flex-pack: center;
	    justify-content: center;
	    text-align: center;
	}
	.selected
	{
		background: #569ff7;
    	-webkit-box-shadow: none;
    	box-shadow: none;
    	cursor: pointer;
    	color: #fff;
    	border-color: #569ff7;
	}
	.selected a { color: #fff;}
</style>

#set($strid = $DC.getRecId())
#set($array = [])
#set($statement = $PreparedQuery.prepare($DbConnection, "SELECT DT_DATUM FROM DATAGROUP('2B3C0A9029E15B3BC985E2EA2069194EA92D23AB') WHERE FKSTRID = ?"))
$statement.setString(1, $strid)

#set($rs = $statement.executeQuery())
#foreach($element in $rs)
	#set($intYear = $element.getDateValue(1).getYear() + 1900)
	#set($intMonth = $element.getDateValue(1).getMonth())
	#set($ignoreValue = $array.add($element.getDateValue(1)))
#end
$rs.close()
$statement.close()

#set($intNextMonth = $intMonth + 1)
#set($dtFirst = $DtUtil.date($intYear, $intMonth, 1, $User.getTimeZone()))
#set($dtLast = $DtUtil.date($intYear, $intNextMonth, 0, $User.getTimeZone()))

#set($intFirstDay = $dtFirst.format('d'))
#set($intLastDay = $dtLast.format('d'))
#set($intBefore = $dtFirst.getDay())

#set($intAfter = $dtLast.getDay())
#set($range = [$TextUtil.parseInt($dtFirst.format('d'))..$TextUtil.parseInt($dtLast.format('d'))])

<div class="CalenderContainer">
<span class="WeekdayContainer">Mo.</span>
<span class="WeekdayContainer">Di.</span>
<span class="WeekdayContainer">Mi.</span>
<span class="WeekdayContainer">Do.</span>
<span class="WeekdayContainer">Fr.</span>
<span class="WeekdayContainer">Sa.</span>
<span class="WeekdayContainer">So.</span>

#if($intBefore == 0) #set($intBefore = 7) #end
#if($intBefore != 1)
	#foreach($i in [2..$intBefore])
		<span class="DayContainer"></span>
	#end
#end

#foreach($i in $range)
	#if ($array.contains($DtUtil.date($intYear, $intMonth, $i, $User.getTimeZone())))
		#set($hexYear = $Codec.hexEncodeString($intYear.toString(), "UTF-8"))
		#set($hexMonth = $Codec.hexEncodeString($intMonth.toString(), "UTF-8"))
		#set($hexDay = $Codec.hexEncodeString($i.toString(), "UTF-8"))
		#set($hexSTRID = $Codec.hexEncodeString($strid, "UTF-8"))
		<span class="DayContainer selected">$i
</span>
	#else
		<span class="DayContainer">$i</span>
	#end
#end


#if($intAfter != 0)
	#foreach($i in [$intAfter..6])
		<span class="DayContainer"></span>
	#end
#end
</div>

Code language: HTML, XML (xml)

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Hallo! Mein Name ist Marco Friedersdorf und bin Freelancer im Bereich der Software-Entwicklung und IT-Beratung. Mit Artikeln wie diesem möchte ich einen kleinen Einblick in meine Arbeit geben und über die Dinge sprechen, die mich als Informatiker beschäftigen.
tripadvisor flickr americanexpress bandcamp basecamp behance bigcartel bitbucket blogger codepen compropago digg dribbble dropbox ello etsy eventbrite evernote facebook feedly github gitlab goodreads googleplus instagram kickstarter lastfm line linkedin mailchimp mastercard medium meetup messenger mixcloud paypal periscope pinterest quora reddit rss runkeeper shopify signal sinaweibo skype slack snapchat soundcloud sourceforge spotify stackoverflow stripe stumbleupon trello tumblr twitch twitter uber vimeo vine visa vsco wechat whatsapp wheniwork wordpress xero xing yelp youtube zerply zillow px aboutme airbnb amazon pencil envelope bubble magnifier cross menu arrow-up arrow-down arrow-left arrow-right envelope-o caret-down caret-up caret-left caret-right