Georges Soares Posted June 27, 2017 Share Posted June 27, 2017 In searching the forum I found neither on the internet nor how to change the UniCalendarPanel: 1. Start viewing by day and not by month 2. Being by day, show only the hours I want, example, from 8am until 6pm 3. disable a certain time zone, type 11am not possible to choose 3. Change the time division, this every 30 minutes, put 15 minutes Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2017 Share Posted June 28, 2017 Hi, 1. Start viewing by day and not by month Can you try this approach for now ?!: UniCalendarPanel1 -> ClientEvents -> ExtEvents -> add function afterrender: function afterrender(sender, eOpts) { // 0 - Day // 1 - Week // 2 - Month sender.setActiveView(0); } Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 28, 2017 Author Share Posted June 28, 2017 Thanks for the quick response. The other questions can you tell me if it's possible? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2017 Share Posted June 28, 2017 The other questions can you tell me if it's possible? Yes, But perhaps this is not easy Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2017 Share Posted June 28, 2017 There is a similar question on the forum: http://forums.unigui.com/index.php?/topic/5401-unicalendar-regional-settings/&do=findComment&comment=27715 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2017 Share Posted June 28, 2017 Need to analyze,The above solution should help you with the following issues: In searching the forum I found neither on the internet nor how to change the UniCalendarPanel: 2. Being by day, show only the hours I want, example, from 8am until 6pm 4. Change the time division, this every 30 minutes, put 15 minutes Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 30, 2017 Author Share Posted June 30, 2017 I already use the code given above, it was very handy to put the time in default 24. But I tried to change it to show only a few hours but without success. See the altered part and the result in the image, I would like in this case that it showed the hour starting at 1:00 p.m. dt = Ext.Date.clearTime(new Date('5/26/1972')); for(i=0; i<24; i++){ if (i > 13){ times.push(Ext.Date.format(dt, 'G:i')); dt = Ext.calendar.util.Date.add(dt, {hours: 1});} } Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted July 3, 2017 Author Share Posted July 3, 2017 [sOLUTION] After thinking and researching, I began to understand the code and managed to make the changes. In the code to change the start of the agenda Just change Dt = Ext.Date.clearTime (new Date ('5/26/1972')); for Dt = new Date ('5/26/1972 13:00:00'); And if you still want to increase or decrease the time divisions you can change Dt = Ext.calendar.util.Date.add (dt, {hours: 1}); for Dt = Ext.calendar.util.Date.add (dt, {hours: 0.5}); Be sure to set that part of the code to the desired amount of interval For (i = 0; i <24; i ++) Thank you guys who tried to help. If anyone has doubts let me know. Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted July 3, 2017 Author Share Posted July 3, 2017 // private applyTemplate : function(o){ this.today = Ext.calendar.util.Date.today(); this.dayCount = this.dayCount || 1; var i =0, days = [], dt = Ext.Date.clone(o.viewStart), times = []; for(; i<this.dayCount; i++){ days[i] = Ext.calendar.util.Date.add(dt, {days: i}); } // use a fixed DST-safe date so times don't get skipped on DST boundaries dt = new Date('5/26/1972 08:00:00'); for(i=0; i<7; i++){ times.push(Ext.Date.format(dt, 'G:i')); dt = Ext.calendar.util.Date.add(dt, {hours: 0.5}); } dt = new Date('5/26/1972 13:00:00'); for(i=0; i<11; i++){ times.push(Ext.Date.format(dt, 'G:i')); dt = Ext.calendar.util.Date.add(dt, {hours: 0.5}); } return this.applyOut({ days: days, dayCount: days.length, times: times }, []).join(''); } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 3, 2017 Share Posted July 3, 2017 Hi, But here may be a problem with the assignment of events. Have you checked? Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted July 3, 2017 Author Share Posted July 3, 2017 Truth, you were quick and you figured out that there would be a problem, and you really have it, I still have to break my head and if I can help, thank you. Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted July 3, 2017 Author Share Posted July 3, 2017 Unfortunately the UniCalendarPanel component needs to evolve a bit more to accept the customizations needed for day to day. In this case I have chosen to be removing it from my project, and the above solution does not work at all. Thankfully, uniGUI brings other options that we can use for our needs, so I put the Grid with HTML generated in SQL so that I can set up my agenda in the way that I think is best. Follow the image of the solution that I did, I am available. Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted November 24, 2017 Share Posted November 24, 2017 Hello @Georges Soares Could you share the code of the work you did. How did you make the HTML grid? Thank you. Quote Link to comment Share on other sites More sharing options...
Lucianoildo Posted February 9, 2018 Share Posted February 9, 2018 Hello @Georges Soares Could you share the code of the work you did. How did you make the HTML grid? Thank you. 1 Quote Link to comment Share on other sites More sharing options...
lucas.martinello Posted May 28, 2018 Share Posted May 28, 2018 // private applyTemplate : function(o){ this.today = Ext.calendar.util.Date.today(); this.dayCount = this.dayCount || 1; var i =0, days = [], dt = Ext.Date.clone(o.viewStart), times = []; for(; i<this.dayCount; i++){ days[i] = Ext.calendar.util.Date.add(dt, {days: i}); } // use a fixed DST-safe date so times don't get skipped on DST boundaries dt = new Date('5/26/1972 08:00:00'); for(i=0; i<7; i++){ times.push(Ext.Date.format(dt, 'G:i')); dt = Ext.calendar.util.Date.add(dt, {hours: 0.5}); } dt = new Date('5/26/1972 13:00:00'); for(i=0; i<11; i++){ times.push(Ext.Date.format(dt, 'G:i')); dt = Ext.calendar.util.Date.add(dt, {hours: 0.5}); } return this.applyOut({ days: days, dayCount: days.length, times: times }, []).join(''); } This in UniCalendarPanel1 -> ClientEvents -> ExtEvents -> function afterrender or another? Quote Link to comment Share on other sites More sharing options...
hakan@holmedal.se Posted June 1, 2018 Share Posted June 1, 2018 Hi, Can you try this approach for now ?!: UniCalendarPanel1 -> ClientEvents -> ExtEvents -> add function afterrender: function afterrender(sender, eOpts) { // 0 - Day // 1 - Week // 2 - Month sender.setActiveView(0); } I didn't get this to work so I tried this (ClientEvents->UniEvents->beforeInit) I'm using version 1.10.0.1462 function beforeInit(sender, config) { sender.defaultView = 'day'; } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 1, 2018 Share Posted June 1, 2018 Hi, I didn't get this to work so I tried this (ClientEvents->UniEvents->beforeInit) I'm using version 1.10.0.1462 Yes, this solution was for ExtJS4 Quote Link to comment Share on other sites More sharing options...
ZigZig Posted March 13, 2019 Share Posted March 13, 2019 On 6/1/2018 at 2:39 PM, Sherzod said: Hi, Yes, this solution was for ExtJS4 Hi, What is the solution for uniGUI 1.7 (ExtJS 6.7) ? "setActiveView" and "defaultView" don't work anymore. Thank you! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 13, 2019 Share Posted March 13, 2019 9 minutes ago, ZigZig said: What is the solution for uniGUI 1.7 (ExtJS 6.7) ? "setActiveView" and "defaultView" don't work anymore. Have you tried this config for example? UniCalendarPanel -> ClientEvents -> UniEvents -> function beforeInit(sender, config) { config.defaultView = 'week'; //day, month (default) } 2 Quote Link to comment Share on other sites More sharing options...
ZigZig Posted March 13, 2019 Share Posted March 13, 2019 It works perflectly, thank you!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.