Hi all
We've downloaded a local version of the Events Portal and currently working on this before uploading the changes to the hosted Portal. Two areas I'm struggling with are:
I can see in home.component.ts how the orderEvents function is working but that's only useful when selecting the dropdown option and changing the order manually. Anyone know what settings need changing here for the Events to display in date order without the need to manually use the dropdown field on the Home page?
As for the Event filtering, I know that if we move the Event back to Draft then it will come off the Portal but I would have assumed that only those Events with a date of today onwards should be shown by default. Any ideas how we can filter the list so Events with a past date are not shown on the list?
Thanx for any advice as always.
Steven
Hi Steven,
Please take a look to my reply in that thread. :)
Hi Clofly
Yes your suggestions worked a charm. Only problem I'm having now is using the DeployToDynamics365Instance.ps1 delpoyment script as it appears to connect to the instance, it appears to update everything but the site does not change in anyway (even after many cache clearances and portal restarts).
I can manually upload the files and what I've changed works but I've made an alteration to the environment.ts file (took the environment.d365.ts file and changed this to simply environment.ts and made my changes there on the local deployment and all works as expected). Doesn't seem to upload the files from my local system to the hosted environment though.
I've asked about this here: community.dynamics.com/.../push-changes-to-hosted-portal but to date I've not heard any thots.
Any ideas would be appreciated.
Steven
Hi Steven,
Please ignore this reply.
Clofly 2 Mao is my backup account, there is issue with my main account in recent days, now the issue is fixed, this is just a simple reply from my main account.
Thanx Clofly, works a charm.
Hi Steven,
Question 1:
You can copy "date-desc"(or "date-asc") sort function from the orderEvents function to the loadPublishedEvents function, then event records will sort in date descending order.
Test
Question 2:
In home.component.html, we bind a custom function to control event display. As the screenshot reveals, we pass event object as parameter to the function.
In home.component.ts, build the custom function.
private compareDate(event: Event): boolean { let tzoffset = (new Date()).getTimezoneOffset() * 60000; let today = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1); if (event.startDate.toString() > today) { return true; } else { return false; } }
Get our local time in iso-string format and do comparison between it and the start date of event.
(Due to event start date is stored in iso-string format.)
Test
I have 5 events and event "Feb Event" starts at 2/26/2021 11:00 AM.
Now time for me is 2/26/2021 11:19 AM, so the "Feb Event" record will be hidden.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156