The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hi everyone, I need help about planner view.

I couldn't change planners view. It's view like this

But I want to show weekly, monthly, like these

How can I do that?

And what is dimensions on planner? What can we add dimensions on planner?

Edited: Mehmet Tuğrul SARIÇİÇEK - Nov 17, 2015 02:50 AM
 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Mehmet Tuğrul SARIÇİÇEK.

Here are examples how to add groups and present time in other ways:

Code
   CurrentDate = CurrentDate();
   NewItem = Planner.Items.Add(BegOfDay(CurrentDate), EndOfDay(CurrentDate));
   Dimensions = New Map;
   Dimensions.Insert("1", 0);
   NewItem.DimensionValues = New FixedMap(Dimensions);
   NewItem.Text = NStr("en = 'Meeting'");
   
   Planner.CurrentRepresentationPeriods.Clear();
   Planner.CurrentRepresentationPeriods.Add(BegOfWeek(CurrentDate), EndOfWeek(CurrentDate));

Download 1Cv8.cf (8.29 KB)
 
#3
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

This example shows how to display a month in a calendar.

You can also find here how to set color and icon for the time interval.

Code
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
   OneDay = 24 * 60 * 60;
   CurrentDate = CurrentSessionDate();
   NewItem = Planner.Items.Add(BegOfDay(CurrentDate), EndOfDay(CurrentDate));
   NewItem.Text = NStr("en = 'Meeting'");
   
   // Planned interval icon.
   NewItem.Picture = PictureLib.Calculator;
   // Planned interval background color.
   NewItem.BackColor = GetMeetingColor();
   
   Planner.CurrentRepresentationPeriods.Clear();
   Planner.CurrentRepresentationPeriods.Add(BegOfMonth(CurrentDate), BegOfMonth(CurrentDate) + 7 * 5 * OneDay - 1);
   
   // Background colors for time intervals.
   Planner.BackgroundIntervals.Clear();
   FirstWeekDay = BegOfWeek(BegOfMonth(CurrentDate));
   For I = 0 To 6 Do
      Days = Planner.BackgroundIntervals.Add(FirstWeekDay + (I*7 - 2)*OneDay, FirstWeekDay + (I*7)*OneDay);
      Days.Color = GetWeekendColor();
   EndDo;
EndProcedure

&AtServer
Function GetMeetingColor()
   
   Return StyleColors.Meeting;
   
EndFunction

&AtServer
Function GetWeekendColor()
   
   Return StyleColors.Weekend;
   
EndFunction

 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

You can also add several intervals to compare them.

Code
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
   OneDay = 24 * 60 * 60;
   CurrentDate = CurrentSessionDate();
   NewItem = Planner.Items.Add(BegOfHour(CurrentDate), EndOfHour(CurrentDate));
   NewItem.Text = NStr("en = 'Meeting'");
   
   // Adding several intervals to compare.
   Planner.CurrentRepresentationPeriods.Clear();
   FirstDay = BegOfDay(CurrentDate);
   For I = 0 To 6 Do
      Planner.CurrentRepresentationPeriods.Add(FirstDay + (I*7)*OneDay, EndOfDay(FirstDay + (I*7)*OneDay));
   EndDo;
EndProcedure

Download 1Cv8.cf (8.29 KB)
 
#5
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Thank you so much Timofey Bugaevsky, thank you

 
#6
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hello Timofey Bugaevsky,

It works thank you but I have an another problem. It doesn't looked like yours. In your solution show days names(Monday, Tuesday etc.) But on mine looked like this

And It couldn't find Weekend and Meeting colors.

 
#7
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Mehmet Tuğrul SARIÇİÇEK, this is because I configured date formats for English language, you should specify it in Planner and Time scale items settings.

Please, add images using Load attachment for this message. Because when you use third-party services, those images can be displayed not for all users and also can disappear with time.

 
#8
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Timofey Bugaevsky,

I setted for Turkey but it doesn't show day names, it show date of days. I want to show like this but it doesn't

 
#9
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Mehmet Tuğrul SARIÇİÇEK,

Use ddd as date format.

If this will not work, please, provide your sample configuration where I can find your problem.

Why you did not attach an image to the message and used a third-party service again? Are there any problem with that?

 
#10
People who like this: 0 Yes / 0 No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hi Timofey Bugaevsky,

I solved this problem, I missed one little detail. But I handle a problem. I can show calender like yours but it can't show date. I mean it show just name of date but user can't know what is date of day. I mean I need to show date and name of date.

I couldn't understand attach an image to the message and used a third-party service? How can I do that?

 
#11
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Mehmet Tuğrul SARIÇİÇEK,

You can use same format as described in the Global context / Format() function description.
DF - date format.
d - date (digits) without a leading zero;
dd - date (digits) with a leading zero;
ddd - abbreviation of the day of the week *);
dddd - full name of the day of the week *);
M - month number (digits) without a leading zero;
MM - month number (digits) with a leading zero;
MMM - month abbreviation*);
MMMM - month full name *);
q - quarter number per year;
y - year number without the century and a leading zero;
yy - year number without the century with a leading zero;
yyyy - year number with the century;
h - an hour in the 12-hour format without leading zeros;
hh - an hour in the 12-hour format with leading zeros;
H - an hour in the 24-hour format without leading zeros;
HH - an hour in the 24-hour format with a leading zero;
m - a minute without a leading zero;
mm - a minute with a leading zero;
s - a second without a leading zero;
ss - a second with a leading zero;
tt - AM/PM display (valid only for configuration languages supporting the 12-hour format for displaying time).

 
Subscribe
Users browsing this topic (guests: 5, registered: 0, hidden: 0)