Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > how to change planner views form

Forum

Search UsersRules
how to change planner views form
#1
Active user
Points:: 0
Joined:: Jul 28, 2015

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?

Profile
#2
Guest
Points::
Joined::

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));

Profile
#3
Guest
Points::
Joined::

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

Profile
#4
Guest
Points::
Joined::

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

Profile
#5
Active user
Points:: 0
Joined:: Jul 28, 2015

Thank you so much Timofey Bugaevsky, thank you

Profile
#6
Active user
Points:: 0
Joined:: Jul 28, 2015

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.

Profile
#7
Guest
Points::
Joined::

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.

Profile
#8
Active user
Points:: 0
Joined:: Jul 28, 2015

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

Profile
#9
Guest
Points::
Joined::

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?

Profile
#10
Active user
Points:: 0
Joined:: Jul 28, 2015

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?

Profile
#11
Guest
Points::
Joined::

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).

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



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.