From c84c63724ad06c97943ce13690d06e677e8bb1ec Mon Sep 17 00:00:00 2001 From: saiganesh-sakthivel Date: Wed, 7 Dec 2022 17:24:30 +0530 Subject: [PATCH 1/2] modified the README.md --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbf1473..a918054 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,70 @@ -**[View document in Syncfusion Xamarin Knowledge base](https://www.syncfusion.com/kb/12251/how-to-show-a-particular-week-in-a-day-view-of-xamarin-schedule-sfschedule)** +# How to show a particular week in a day view of Xamarin Schedule (SfSchedule) +You can restrict the day view for the selected week only by using the [MinDisplayDate](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_MinDisplayDate) and [MaxDisplayDate](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_MaxDisplayDate) properties of Xamarin [SfSchedule](https://www.syncfusion.com/xamarin-ui-controls/xamarin-scheduler). + +**XAML** + +Set the [FirstDayOfWeek](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_FirstDayOfWeek) as 2 and [ScheduleView](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfSchedule.XForms.SfSchedule.html#Syncfusion_SfSchedule_XForms_SfSchedule_ScheduleView) as `WeekView`. +``` + +        +        +    +    +        +    +    +        +            +                +            +        +    +``` +**C#** + +You can get the week’s first and last date by using the `VisibleDatesChangedEventArgs` argument of `VisibleDatesChanged` event, using this you can set the `MinDisplayDate` and `MaxDisplayDate` for schedule while navigating to day view. Also, changing the min/max value while navigating back to week view. +``` +public class SchedulerBehavior : Behavior +    { +        SfSchedule schedule; +        ToolbarItem day, week; +        DateTime? minDate, maxDate; +        protected override void OnAttachedTo(ContentPage bindable) +        { +            base.OnAttachedTo(bindable); +            schedule = bindable.FindByName("schedule"); +            day = bindable.FindByName("Day"); +            week = bindable.FindByName("Week"); +  +            schedule.VisibleDatesChangedEvent += Schedule_VisibleDatesChangedEvent; +  +            day.Clicked += Day_Clicked; +            week.Clicked += Week_Clicked; +        } +        private void Schedule_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs e) +        { +            if (schedule.ScheduleView == ScheduleView.WeekView) +            { +                minDate = e.visibleDates[0].Date; +                maxDate = e.visibleDates[e.visibleDates.Count - 1].Date; +  +                schedule.MinDisplayDate = new DateTime(01, 01, 01); +                schedule.MaxDisplayDate = new DateTime(9999, 12, 31); +            } +        } +        private void Week_Clicked(object sender, EventArgs e) +        { +            schedule.ScheduleView = ScheduleView.WeekView; +        } +  +        private void Day_Clicked(object sender, EventArgs e) +        { +            schedule.ScheduleView = ScheduleView.DayView; +            schedule.MinDisplayDate = (DateTime)minDate; +            schedule.MaxDisplayDate = (DateTime)maxDate; +        } +    } +``` + +KB article - [How to show a particular week in a day view of Xamarin Schedule (SfSchedule)](https://www.syncfusion.com/kb/12251/how-to-show-a-particular-week-in-a-day-view-of-xamarin-schedule-sfschedule) \ No newline at end of file From 82c701b2bbe9523c52b1584ba158885e9d65d14a Mon Sep 17 00:00:00 2001 From: VinothKumar-Ganesan <121218063+VinothKumar-Ganesan@users.noreply.github.com> Date: Mon, 6 Feb 2023 14:11:39 +0530 Subject: [PATCH 2/2] Gitleaks action file added --- .github/workflows/gitleaks.yaml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/gitleaks.yaml diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml new file mode 100644 index 0000000..d9a8e36 --- /dev/null +++ b/.github/workflows/gitleaks.yaml @@ -0,0 +1,38 @@ +name: Secret Value found! +on: + push: + public: +jobs: + scan: + name: gitleaks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install the gitleaks + run: wget https://github.com/zricethezav/gitleaks/releases/download/v8.15.2/gitleaks_8.15.2_linux_x64.tar.gz + shell: pwsh + - name: Extract the tar file + run: tar xzvf gitleaks_8.15.2_linux_x64.tar.gz + - name: Generate the report + id: gitleaks + run: $GITHUB_WORKSPACE/gitleaks detect -s $GITHUB_WORKSPACE -f json -r $GITHUB_WORKSPACE/leaksreport.json + shell: bash + continue-on-error: true + - name: Setup NuGet.exe + if: steps.gitleaks.outcome != 'success' + uses: nuget/setup-nuget@v1 + with: + nuget-version: latest + - name: Install the dotnet + if: steps.gitleaks.outcome != 'success' + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '3.1.x' + - name: Install the report tool packages + if: steps.gitleaks.outcome != 'success' + run: | + nuget install "Syncfusion.Email" -source "https://nexus.syncfusion.com/repository/nuget-hosted/" + dir $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1 + dotnet $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1/Email.dll "citeam@syncfusion.com" "$GITHUB_REF_NAME" ${{ secrets.NETWORKCREDENTIALS }} ${{ secrets.NETWORKKEY }} "$GITHUB_WORKSPACE" + exit 1 \ No newline at end of file