Need help

Waspaman

Lurker
I am trying to set up a widget that displays the day of the week only for that day. The next day would appear in another location within the same widget and so on.
 
Welcome to Android Forums.

Your description is pretty sketchy. Display the day of the week only for the day? Appear in another location within the widget?

What have you created so far?

... Thom
 

Phalon4

Android Enthusiast
I am trying to set up a widget that displays the day of the week only for that day. The next day would appear in another location within the same widget and so on.

Sounds to me like you want a custom built app set for your specifications.
 

Waspaman

Lurker
Thread starter
I am making a widget to display the time, date, weather, battery.......
I have 7 individual boxes for the day of the week. I am trying to have the current day appear in it's designated box while the other days, also in their own designated boxes remain blank.
 
The key to learning Tasker is to start out simple and nibble away at enhancing it. Can you currently display the day of the week? Do you have anything working in the task yet?

If you long press on the task name you can choose ... settings / Export / Description to clipboard and then paste them into a post here.

This flashes the current day ...

Dev5
A3: Variable Set [ Name:%par1 To:%TIMES Recurse Variables:Off Do Maths:Off Append:Off ]
A1: Variable Set [ Name:%par2 To:dddd Recurse Variables:Off Do Maths:Off Append:Off ]
A2: Perform Task [ Name:getFormattedDate Priority:%priority Parameter 1 (%par1):%par1 Parameter 2 (%par2):%par2 Return Value Variable:%wrk Stop:Off ]
A3: Flash [ Text:%wrk Long:On ]

getFormattedDate
Run Both Together
A1: JavaScriptlet [ Code:var gsMonthNames = new Array(
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
);

var gsDayNames = new Array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);

var d = new Date(par[0] * 1000);
var f = par[1];

var formatteddate = f.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,
function($1)
{
switch ($1)
{
case 'yyyy': return d.getFullYear();
case 'yy': return ('0' + d.getFullYear()).slice(-2);
case 'mmmm': return gsMonthNames[d.getMonth()];
case 'mmm': return gsMonthNames[d.getMonth()].slice(0,3);
case 'mm': return ('0' + (d.getMonth() + 1)).slice(-2);
case 'dddd': return gsDayNames[d.getDay()];
case 'ddd': return gsDayNames[d.getDay()].slice(0,3);
case 'dd': return ('0' + d.getDate()).slice(-2);
case 'hh': return ('0' + ((h = d.getHours() % 12) ? h : 12)).slice(-2);
case 'HH': return ('0' + d.getHours()).slice(-2);
case 'nn': return ('0' + d.getMinutes()).slice(-2);
case 'ss': return ('0' + d.getSeconds()).slice(-2);
case 'a/p': return d.getHours() < 12 ? 'a' : 'p';
}
}
); Libraries:45 Auto Exit:On Timeout (Seconds):45 ]
A2: Return [ Value:%formatteddate Stop:On ]

... yes it is a t least an intermediate solution.

... Thom
 
Last edited:
Top