Kodi Community Forum

Full Version: Different outputs of System.Date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to get the month separate and numerical date separate like so:

09
September

I want to put it in a calendar looking image, number on top- month on the bottom, but system.date doesnt output the look I want. Is this possible?
I guess the only way you can achieve this it by the use of SubString(info,string,[Left or Right]) but it's going to be lots of conditions.

ie

To get the 1st day of the month you'd need -

PHP Code:
SubString(System.Date,1,[align=left]) + ![SubString(System.Date,10,[align=left]) | SubString(System.Date,11,[align=left]) | SubString(System.Date,12,[align=left]) | SubString(System.Date,13,[align=left]) | SubString(System.Date,14,[align=left]) | SubString(System.Date,15,[align=left]) | SubString(System.Date,16,[align=left]) | SubString(System.Date,17,[align=left]) | SubString(System.Date,18,[align=left]) | SubString(System.Date,19,[align=left])] 

Months are easier of course -

PHP Code:
SubString(System.Date,$LOCALIZE[21]) for January 
How would you do just Monday, Tuesday, etc?
PHP Code:
<control type="label">
   <
label>11</label>
   <
visible>SubString(System.Date,$LOCALIZE[11])</visible>
</
control

From the strings.xml -

PHP Code:
<string id="11">Monday</string>
<
string id="12">Tuesday</string>
<
string id="13">Wednesday</string>
<
string id="14">Thursday</string>
<
string id="15">Friday</string>
<
string id="16">Saturday</string>
<
string id="17">Sunday</string

Obviously it would be easier if we could just get the day, date, month and year values separately at the skin level but that's for Jonathan to comment on.
maybe something like that
http://en.wikipedia.org/wiki/ISO_8601
to format the time
Thanks Hitcher I'll keep this bookmarked, my project wont be done for awhile so hopefully a simpler solution pops up like:

System.Date(Month)
System.Date(Day)
System.Date(DayofWeek)

This really ties a look I want together so I do need it, Hopefully I wont have to do it the long way...

@Hitcher

So is the reason you included 10-19 when checking for the #1 is it'll return true based on the beginning 1 in 10-19?

So for the number 2 I would need to have it !visible for 20-29 then the same for 30 and 31 for the #3...
That's how I think it'll work, yes.