Hi,
I need to create an interface for timesheet entry. In the interface when I select the month and year the calendar for that month should be displayed in a grid with days (1, 2 ,3 etc) as links so that I can click the link to enter the number of hours worked on that day. How can I acheive this? I need to create this interface in 18.1 version. Thanks in advance.
Discussion posts and replies are publicly visible
Can you tell me the code for this asap
I've avoided using plugins, CDTs and referencing other rules but this works
a!localVariables( local!blankWeekDictionary: { monday: {}, tuesday: {}, wednesday: {}, thursday: {}, friday: {}, saturday: {}, sunday: {} }, local!today: todate(local(now())), local!month: month(local!today), local!year: year(local!today), local!daysInMonth: daysinmonth( local!month, local!year ), local!unsortedMonthData: a!forEach( items: 1 + enumerate(local!daysInMonth), expression: a!localVariables( local!date: date( local!year, local!month, fv!item ), { date: local!date, dayNumberInMonth: fv!item, dayNumberInWeek: weekday( local!date, 2 ), dayName: text(local!date, "dddd") } ) ), local!sortedMonthData: a!forEach( items: 1 + enumerate(7) /*There are 7 days in a week*/, expression: a!localVariables( local!matchingDayNumberInWeekDetails: index( local!unsortedMonthData, wherecontains( fv!item, tointeger( index( local!unsortedMonthData, "dayNumberInWeek", {} ) ) ), {} ), local!matchingDayNumberInMonth: index( local!matchingDayNumberInWeekDetails, "dayNumberInMonth", {} ), local!matchingDayNumberInMonth ) ), reduce( a!update, local!blankWeekDictionary, merge( { "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" }, local!sortedMonthData ) ) )
Thnxx
hey I need your help.
Below is my code . Using this expression i want to display calendar . I am facing problem in displaying .
If you can correct my code ...I will be very thank full .
a!localVariables( local!s:weekday(date(ri!y,ri!m,1),1), local!t:daysinmonth(ri!m,ri!y), choose(local!s, if(local!s=1, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Sunday", { sun:if(fv!item+1<local!t+1,fv!item+1,{}), mon:if(fv!item+2<local!t+1,fv!item+2,{}), tues:if(fv!item+3<local!t+1,fv!item+3,{}), wed:if(fv!item+4<local!t+1,fv!item+4,{}), thurs:if(fv!item+5<local!t+1,fv!item+5,{}), fri:if(fv!item+6<local!t+1,fv!item+6,{}), sat:if(fv!item+7<local!t+1,fv!item+7,{}) } ,{})} ),{}), if(local!s=2, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Monday", { mon:if(fv!item+1<local!t+1,fv!item+1,{}), tues:if(fv!item+2<local!t+1,fv!item+2,{}), wed:if(fv!item+3<local!t+1,fv!item+3,{}), thurs:if(fv!item+4<local!t+1,fv!item+4,{}), fri:if(fv!item+5<local!t+1,fv!item+5,{}), sat:if(fv!item+6<local!t+1,fv!item+6,{}), sun:if(fv!item+7<local!t+1,fv!item+7,{}), } ,{})} ),{}), if(local!s=3, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Tuesday", { tues:if(fv!item+1<local!t+1,fv!item+1,{}), wed:if(fv!item+2<local!t+1,fv!item+2,{}), thurs:if(fv!item+3<local!t+1,fv!item+3,{}), fri:if(fv!item+4<local!t+1,fv!item+4,{}), sat:if(fv!item+5<local!t+1,fv!item+5,{}), sun:if(fv!item+6<local!t+1,fv!item+6,{}), mon:if(fv!item+7<local!t+1,fv!item+7,{}), } ,{})} ),{}), if(local!s=4, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Wednesday", { wed:if(fv!item+1<local!t+1,fv!item+1,{}), thurs:if(fv!item+2<local!t+1,fv!item+2,{}), fri:if(fv!item+3<local!t+1,fv!item+3,{}), sat:if(fv!item+4<local!t+1,fv!item+4,{}), sun:if(fv!item+5<local!t+1,fv!item+5,{}), mon:if(fv!item+6<local!t+1,fv!item+6,{}), tues:if(fv!item+7<local!t+1,fv!item+7,{}) } ,{})} ),{}), if(local!s=5, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Thursday", { thurs:if(fv!item+1<local!t+1,fv!item+1,{}), fri:if(fv!item+2<local!t+1,fv!item+2,{}), sat:if(fv!item+3<local!t+1,fv!item+3,{}), sun:if(fv!item+4<local!t+1,fv!item+4,{}), mon:if(fv!item+5<local!t+1,fv!item+5,{}), tues:if(fv!item+6<local!t+1,fv!item+6,{}), wed:if(fv!item+7<local!t+1,fv!item+7,{}), } ,{})} ),{}), if(local!s=6, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Friday", { fri:if(fv!item+1<local!t+1,fv!item+1,{}), sat:if(fv!item+2<local!t+1,fv!item+2,{}), sun:if(fv!item+3<local!t+1,fv!item+3,{}), mon:if(fv!item+4<local!t+1,fv!item+4,{}), tues:if(fv!item+5<local!t+1,fv!item+5,{}), wed:if(fv!item+6<local!t+1,fv!item+6,{}), thurs:if(fv!item+7<local!t+1,fv!item+7,{}) } ,{})} ),{}), if(local!s=7, a!forEach( items:enumerate(daysinmonth(ri!m,ri!y)), expression:{if(text(date(ri!y,ri!m,fv!item+1),"dddd")="Saturday", { sat:if(fv!item+1<local!t+1,fv!item+1,{}), sun:if(fv!item+2<local!t+1,fv!item+2,{}), mon:if(fv!item+3<local!t+1,fv!item+3,{}), tues:if(fv!item+4<local!t+1,fv!item+4,{}), wed:if(fv!item+5<local!t+1,fv!item+5,{}), thurs:if(fv!item+6<local!t+1,fv!item+6,{}), fri:if(fv!item+7<local!t+1,fv!item+7,{}), } ,{})} ),{}),))
How may I help?
According to my code dates are displaying like this. I am not able to improve my code . how can i?