Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.randevu_creator);


            user_data = JsonConvert.DeserializeObject <List <model.users> >(Intent.GetStringExtra("data"));
            // dr_data = JsonConvert.DeserializeObject<List<model.doctors>>(Intent.GetStringExtra("dr_data"));

            FindViewById <TextView>(Resource.Id.toolbar_title).Text = Intent.GetStringExtra("dr_name");


            DatePickerDialog dateDialog = new DatePickerDialog(this, OnDateSet, today.Year, today.Month, today.Day);

            dateDialog.DatePicker.MinDate = today.Millisecond;
            dateDialog.Show();
            dateDialog.DismissEvent += (s, e) =>
            {
                if (date == "")
                {
                    dateDialog.Show();
                }

                // do whatever you need here, this will be called on
                // dismiss (clicking on cancel button or outside of dialog)
            };
        }
Пример #2
0
        private void M_edittextCalendar_Click(object sender, EventArgs e)
        {
            try
            {
                m_edittextCalendar.Enabled = false;

                MobileCenter_Helper.TrackEvent(new FileAccessManager(), GetType().Name, "M_edittextCalendar_Click");

                DateTime maxDate          = DateTime.Now.Date.AddDays(Settings.NbSelectableDaysAfterToday);
                DateTime minDate          = DateTime.Now.Date.AddDays(Settings.NbSelectableDaysBeforeToday);
                DateTime firstJanuary1970 = new DateTime(1970, 1, 1, 0, 0, 0);

                //Prompt a calendar
                DatePickerDialog datePicker = new DatePickerDialog(this, Resource.Style.DatePicker_Red_dayMode, OnDateSetDateBegin, DateTime.Now.Year, DateTime.Now.Month - 1, DateTime.Now.Day);
                datePicker.UpdateDate(DateTime.Now);
                datePicker.DatePicker.MaxDate = (long)maxDate.Subtract(firstJanuary1970).TotalMilliseconds;
                datePicker.DatePicker.MinDate = (long)minDate.Subtract(firstJanuary1970).TotalMilliseconds;
                datePicker.DismissEvent      += (senser, eventArgs) => { m_edittextCalendar.Enabled = true; };
                datePicker.Show();
            }
            catch (Exception ex)
            {
                MobileCenter_Helper.ReportError(new FileAccessManager(), ex, GetType().Name, MethodBase.GetCurrentMethod().Name);
            }
        }
        private void TextFechaDesdeEditText_Click(object sender, EventArgs e)
        {
            DatePickerDialog dateDialog = new DatePickerDialog(Activity, OnDateSetDesde, fechaReserva.Year, fechaReserva.Month - 1, fechaReserva.Day);

            dateDialog.DatePicker.MinDate = fechaReserva.Millisecond;
            dateDialog.Show();
        }
Пример #4
0
        public Task <DateTime?> ShowDatePickerAsync(string title, DateTime?defaultDate, DateTime?minDate = null, DateTime?maxDate = null)
        {
            if (_datePickerDialog.IsShowing && _tcsDate != null)
            {
                return(_tcsDate.Task);
            }

            if (minDate.HasValue)
            {
                _datePickerDialog.DatePicker.MinDate = minDate.Value.ToUnixTimeMileseconds();
            }

            if (maxDate.HasValue)
            {
                _datePickerDialog.DatePicker.MaxDate = maxDate.Value.ToUnixTimeMileseconds();
            }

            if (defaultDate.HasValue && defaultDate.Value >= _datePickerDialog.DatePicker.MinDateTime &&
                defaultDate.Value <= _datePickerDialog.DatePicker.MaxDateTime)
            {
                _datePickerDialog.DatePicker.DateTime = defaultDate.Value;
            }

            _tcsDate = new TaskCompletionSource <DateTime?>();

            _datePickerDialog.SetTitle(title);
            _datePickerDialog.Show();

            return(_tcsDate.Task);
        }
Пример #5
0
        private void MaximumDateLayout()
        {
            /****************
            **Maximum Date**
            ****************/
            spaceAdder2      = new TextView(context);
            maxDate          = new TextView(context);
            maxDate.Text     = "Max Date";
            maxDate.TextSize = 20;
            maxDate.Gravity  = GravityFlags.Left;

            //maxDateButton
            maxDateButton          = new Button(context);
            maxDateButton.Text     = "1/12/2018";
            maxDateButton.TextSize = 16;
            maxDateButton.SetBackgroundColor(Color.ParseColor("#8CD4CF"));
            maxDatePicker        = new DatePickerDialog(context, MaxDateSetting, 2018, 12, 1);
            maxDateButton.Click += (object sender, EventArgs e) =>
            {
                maxDatePicker.Show();
            };

            //Separator 1
            underMaxSeparator = new SeparatorView(context, width * 2);
            underMaxSeparator.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            underMaxSeparatorLayoutParam       = new LinearLayout.LayoutParams(width * 2, 5);
            underMaxSeparatorLayoutParam.SetMargins(0, 20, 0, 0);
        }
Пример #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_signup);

            //binding
            _firstnameBinding   = this.SetBinding(() => EditFirstName.Text, () => Vm.FirstName);
            _lastnameBinding    = this.SetBinding(() => EditLastName.Text, () => Vm.LastName);
            _usernameBinding    = this.SetBinding(() => EditUserName.Text, () => Vm.UserName);
            _passwordBinding    = this.SetBinding(() => EditPassword.Text, () => Vm.Password);
            _phonenumberBinding = this.SetBinding(() => EditPhoneNumber.Text, () => Vm.PhoneNumber);
            _startdateBinding   = this.SetBinding(() => EditStartDate.Text, () => Vm.StartDate);

            //Handling TextChanged Event for Phonenumber section
            EditPhoneNumber.TextChanged += HandleTextChanged;

            //DatePickerDialog
            EditStartDate.Click += (sender, e) =>
            {
                DateTime         today  = DateTime.Today;
                DatePickerDialog dialog = new DatePickerDialog(this, this, DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day);
                dialog.DatePicker.DateTime = DateTime.Now;
                dialog.Show();
            };

            //Binding ButtonCommand
            CreateAccountButton.SetCommand("Click", Vm.CreateCommand);
        }
        private void MTxtStartDate_Click(object sender, EventArgs e)
        {
            DatePickerDialog dpd = new DatePickerDialog(this, StartDateListener, selectedStartCalendarYear, selectedStartCalendarMonth, selectedStartCalendarDayOfMonth);

            dpd.DatePicker.MaxDate = Java.Lang.JavaSystem.CurrentTimeMillis();
            dpd.Show();
        }
Пример #8
0
        private void AppearDateDialog()
        {
            DatePickerDialog datePickerDialog = new DatePickerDialog(this);

            Android.Support.V7.App.AlertDialog         datePickerAlertDialog = null;
            Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(this)
                                                                 .SetTitle("Invalid Date")
                                                                 .SetMessage("Too early to create an account. Please select an earlier date under 30 days.")
                                                                 .SetPositiveButton("Ok", (object s, Android.Content.DialogClickEventArgs dialogClickEventArgs) =>
            {
                datePickerAlertDialog.Show();
            });

            datePickerAlertDialog = builder.Create();

            datePickerDialog.DateSet += (s, e) =>
            {
                if (e.Date > DateTime.Now.AddDays(30))
                {
                    datePickerAlertDialog.Show();
                }
                else
                {
                    ViewModel.ServiceStartDate = e.Date;
                    DateButton.Text            = e.Date.ToShortDateString();
                }
            };

            datePickerDialog.Show();
        }
Пример #9
0
        private void SetDatePickerText()
        {
            _reminderDatePickerText = this.FindViewById <EditText>(Resource.Id.reminderDatePickerEditText);
            _reminderDatePickerEditTextReadableValue = this.FindViewById <EditText>(Resource.Id.reminderDatePickerEditTextReadableValue);

            if (!string.IsNullOrEmpty(_reminderDatePickerText.Text))
            {
                var reminderDate = Convert.ToDateTime(_reminderDatePickerText.Text);
                _reminderDatePickerEditTextReadableValue.Text = ReadableDateConverter.Convert(reminderDate);
            }

            _reminderDatePickerEditTextReadableValue.Focusable = false;
            _reminderDatePickerEditTextReadableValue.Click    += delegate
            {
                var reminderDate = DateTime.Now;

                if (!string.IsNullOrEmpty(_reminderDatePickerText.Text))
                {
                    reminderDate = Convert.ToDateTime(_reminderDatePickerText.Text);
                }

                DatePickerDialog dialog = new DatePickerDialog(this, this, reminderDate.Year, reminderDate.Month - 1, reminderDate.Day);
                dialog.SetTitle(GetString(Resource.String.date_selection));
                dialog.DatePicker.SetMinDate(DateTime.Now);
                dialog.Show();
            };
        }
Пример #10
0
        protected virtual void SetupDatePicker(EditText editText, Action <DateTime> onDateSelected, DateTime minDate, DateTime maxDate, Func <DateTime> currentDateFunc)
        {
            editText.Focusable            = false;
            editText.FocusableInTouchMode = false; // user touches widget on phone with touch screen
            editText.Clickable            = false; // user navigates with wheel and selects widget

            editText.SetOnClickListener(new AROnClickListener(() =>
            {
                var currentDate = currentDateFunc.Invoke();

                var datePickerDialog = new DatePickerDialog(Context, (sender, e) =>
                {
                    onDateSelected?.Invoke(e.Date);
                }, currentDate.Year, currentDate.Month, currentDate.Day);

                var javaMinDt = new DateTime(1970, 1, 1);

                datePickerDialog.DatePicker.DateTime = currentDate;

                if (minDate.CompareTo(javaMinDt) > 0)
                {
                    datePickerDialog.DatePicker.MinDate = (long)(minDate - javaMinDt).TotalMilliseconds;
                }

                if (maxDate.CompareTo(javaMinDt) > 0)
                {
                    datePickerDialog.DatePicker.MaxDate = (long)(maxDate - javaMinDt).TotalMilliseconds;
                }

                datePickerDialog.Show();
            }));
        }
Пример #11
0
        //Method for opening date dialog
        public void OnClickDueDateEntry()
        {
            var dateTimeNow           = DateTime.Today;
            DatePickerDialog datePick = new DatePickerDialog(this, this, dateTimeNow.Year, dateTimeNow.Month, dateTimeNow.Day);

            datePick.Show();
        }
        private void DateEditText_Click(object sender, EventArgs e)
        {
            DateTime         currently = DateTime.Now;
            DatePickerDialog dialog    = new DatePickerDialog(Activity, (sender_, args) => { View.FindViewById <EditText>(Resource.Id.ResDate).Text = args.Date.ToString("dd MMM yyyy"); }, currently.Year, currently.Month - 1, currently.Day);

            dialog.Show();
        }
Пример #13
0
        private void ShowDatePicker()
        {
            _isShowing = true;

            _dialog = new DatePickerDialog(Context, DatePicker_DateSet, Element.Date.Year, Element.Date.Month - 1, Element.Date.Day);

            _dialog.SetButton("Done", (sender, e) =>
            {
                Element.SelectedDate = _dialog.DatePicker.DateTime;
                Element.UpdateDate();
                SetText();
            });

            _dialog.SetButton2("Cancel", (sender, e) =>
            {
                _dialog.Hide();
            });

            _dialog.SetButton3("Clear", (sender, e) =>
            {
                Element.SelectedDate = null;
                Element.UpdateDate();
                SetText();
            });

            _dialog.DatePicker.DateTime = Element.SelectedDate ?? DateTime.Now;
            _dialog.DismissEvent       += (sender, args) => _isShowing = false;
            _dialog.Show();
        }
Пример #14
0
        private void DateButton_Click(object sender, EventArgs e)
        {
            DateTime         today            = DateTime.Today;
            DatePickerDialog datePickerDialog = new DatePickerDialog(this, OnDateSet, today.Year, today.Month - 1, today.Day);

            datePickerDialog.Show();
        }
        public void OnPickerClick(object sender, EventArgs e)
        {
            Xamarin.Forms.DatePicker model = Element;
            _dialog = new DatePickerDialog(Context, (o, d) =>
            {
                model.Date = d.Date;
                EController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false);
                Control.ClearFocus();

                _dialog = null;
            }, this.Element.Date.Year, this.Element.Date.Month - 1, this.Element.Date.Day);
            _dialog.DatePicker.MaxDate = UnixTimestampFromDateTime(Element.MaximumDate);
            _dialog.DatePicker.MinDate = UnixTimestampFromDateTime(Element.MinimumDate);

            _dialog.SetButton(blankPicker.DoneButtonText, (k, p) =>
            {
                this.Control.Text = _dialog.DatePicker.DateTime.ToString(Element.Format);
                Element.Date      = _dialog.DatePicker.DateTime;
                blankPicker.SendDoneClicked();
            });
            _dialog.SetButton2(blankPicker.CancelButtonText, (s, el) =>
            {
                blankPicker.SendCancelClicked();
            });
            _dialog.Show();
        }
Пример #16
0
 private void ShowDT(object sender, bool reset)
 {
     if (reset)
     {
         calender         = Calendar.GetInstance(Java.Util.TimeZone.Default);
         baseModel.Year   = calender.Get(CalendarField.Year);
         baseModel.Month  = calender.Get(CalendarField.Month) + 1;
         baseModel.Day    = calender.Get(CalendarField.DayOfMonth);
         baseModel.Hour   = calender.Get(CalendarField.HourOfDay);
         baseModel.Minute = calender.Get(CalendarField.Minute);
     }
     baseModel.CurrentView = false;
     if (sender == datePick)
     {
         datePickerDialog = new DatePickerDialog(this, OnDateShow, baseModel.Year, baseModel.Month - 1, baseModel.Day);
         datePickerDialog.Show();
     }
     else if (sender == timePick)
     {
         timePickerDialog = new TimePickerDialog(this, OnTimeShow, baseModel.Hour, baseModel.Minute, true);
         if (baseModel.TimePickerBundler != null)
         {
             timePickerDialog.OnRestoreInstanceState(baseModel.TimePickerBundler);
         }
         timePickerDialog.Show();
     }
 }
Пример #17
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            var dateButton = view.FindViewById <Button>(Resource.Id.TaskReminderDate);
            var timeButton = view.FindViewById <Button>(Resource.Id.TaskReminderTime);

            dateButton.Click += (sender, args) =>
            {
                var currentDate = DateTime.Parse(ViewModel.FullText, ViewModel.TextProvider.CurrentCulture);
                var dialog      = new DatePickerDialog(Activity, Resource.Style.DatePickerDialogCustom, this, currentDate.Year, currentDate.Month - 1, currentDate.Day);
                dialog.DatePicker.SetMinDate(ViewModel.MinDate);
                dialog.Show();
            };

            timeButton.Click += (sender, args) =>
            {
                var  currentTime    = DateTime.Parse(ViewModel.FullText, ViewModel.TextProvider.CurrentCulture);
                bool is24HourFormat = DateFormat.Is24HourFormat(Activity);
                var  dialog         = new TimePickerDialog(Activity, Resource.Style.TimePickerDialogCustom, this, currentTime.Hour, currentTime.Minute, is24HourFormat);
                dialog.Show();
            };

            return(view);
        }
Пример #18
0
    private void OnClickDateEditText()
    {
        var dateTimeNow             = DateTime.Now;
        DatePickerDialog datePicker = new DatePickerDialog(this, this, dateTimeNow.Year, dateTimeNow.Month, dateTimeNow.Day);

        datePicker.Show();
    }
Пример #19
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.LoginActivity);

            var btnGoBack = FindViewById <Button>(Resource.Id.btnGoBack);

            btnGoBack.Click += delegate {
                this.Finish();
            };

            mGeneratorImage        = new ImageGenerator(this);
            mDateEditText          = FindViewById <EditText>(Resource.Id.txtDateEntered);
            mDisplayGeneratedImage = FindViewById <ImageView>(Resource.Id.imageGen);

            mGeneratorImage.SetIconSize(50, 50);
            mGeneratorImage.SetDateSize(30);
            mGeneratorImage.SetMonthSize(10);
            mGeneratorImage.SetDatePosition(42);
            mGeneratorImage.SetMonthPosition(14);
            mGeneratorImage.SetDateColor(Color.ParseColor("#3c6eaf"));
            mGeneratorImage.SetMonthColor(Color.White);
            mGeneratorImage.SetStorageToSDCard(true);


            mDateEditText.Click += delegate {
                mCurrentDate = Calendar.Instance;
                int mYear  = mCurrentDate.Get(CalendarField.Year);
                int mMonth = mCurrentDate.Get(CalendarField.Month);
                int mDay   = mCurrentDate.Get(CalendarField.DayOfMonth);

                DatePickerDialog mDate = new DatePickerDialog(this, this, mYear, mMonth, mDay);
                mDate.Show();
            };
        }
Пример #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Add);

            RequestPermissions(_permissionsLocation, RequestCameraPermisionId);

            _closeActivity        = FindViewById <ImageView>(Resource.Id.closeActivity);
            _cameraImage          = FindViewById <ImageView>(Resource.Id.cameraImage);
            _autoCompleteTextView = FindViewById <AutoCompleteTextView>(Resource.Id.addresses);
            _player = MediaPlayer.Create(this, Resource.Raw.beep);
            _player.SetVolume(100, 100);
            _datePicker    = FindViewById <EditText>(Resource.Id.datepicker);
            _scanList      = FindViewById <ListView>(Resource.Id.scanList);
            _statusSpinner = FindViewById <Spinner>(Resource.Id.orderStatus);
            _addOrder      = FindViewById <ImageView>(Resource.Id.addOrder);
            var today      = DateTime.Today;
            var dateDialog = new DatePickerDialog(this, OnDateSet, today.Year, today.Month - 1, today.Day);

            dateDialog.DatePicker.MinDate      = today.Millisecond;
            _datePicker.Touch                 += delegate { dateDialog.Show(); };
            _closeActivity.Click              += CloseActivity;
            _cameraImage.Click                += LaunchScanner;
            _autoCompleteTextView.TextChanged += GetAddresses;
            _scanList.ItemClick               += RemoveScannedItem;
            _statusSpinner.Adapter             = FillStatusSpinner();
            _addOrder.Click += HandleOrderSubmit;
        }
        private void TextFechaHastaEditText_Click(object sender, EventArgs e)
        {
            DatePickerDialog dateDialog = new DatePickerDialog(this, OnDateSetHasta, fechaHasta.Year, fechaHasta.Month - 1, fechaHasta.Day);

            dateDialog.DatePicker.MinDate = fechaHasta.Millisecond;
            dateDialog.Show();
        }
        public void OnClick(object sender, EventArgs e)
        {
            HideKeyboard();
            _dialog = new DatePickerDialog(Context, this, blankPicker.Date.Year, blankPicker.Date.Month - 1,
                                           blankPicker.Date.Day);
            _dialog.DatePicker.MaxDate = UnixTimestampFromDateTime(blankPicker.MaximumDate);
            _dialog.DatePicker.MinDate = UnixTimestampFromDateTime(blankPicker.MinimumDate);

            _dialog.SetButton(blankPicker.DoneButtonText, (k, p) =>
            {
                blankPicker.Text = _dialog.DatePicker.DateTime.ToString(blankPicker.Format);
                blankPicker.Date = _dialog.DatePicker.DateTime;
                blankPicker.SendDoneClicked();
                EController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false);
                Control.ClearFocus();
                HideKeyboard();
            });
            _dialog.SetButton2(blankPicker.CancelButtonText, (s, el) =>
            {
                blankPicker.SendCancelClicked();
                EController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false);
                Control.ClearFocus();
                HideKeyboard();
            });

            _dialog.CancelEvent += _dialog_DismissEvent;


            _dialog.Show();
        }
Пример #23
0
        private void MinimumDateLayout()
        {
            /****************
            **Minimum Date**
            ****************/
            spaceAdder1 = new TextView(context);
            minPick     = Calendar.Instance;
            minPick.Set(2012, 0, 1);
            maxPick = Calendar.Instance;
            maxPick.Set(2018, 11, 1);

            //Minimum Date Text
            minDate          = new TextView(context);
            minDate.Text     = "Min Date";
            minDate.TextSize = 20;
            minDate.Gravity  = GravityFlags.Left;

            //minDateButton
            minDateButton = new Button(context);
            minDateButton.SetBackgroundColor(Color.ParseColor("#8CD4CF"));
            minDateButton.Text     = "1/1/2012";
            minDateButton.TextSize = 16;
            minDatePicker          = new DatePickerDialog(context, MinDateSetting, 2012, 1, 1);
            minDateButton.Click   += (object sender, EventArgs e) =>
            {
                minDatePicker.Show();
            };

            //Separator 1
            minMaxSeparator = new SeparatorView(context, width * 2);
            minMaxSeparator.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            minMaxSeparatorLayoutParam       = new LinearLayout.LayoutParams(width * 2, 5);
            minMaxSeparatorLayoutParam.SetMargins(0, 20, 0, 0);
        }
        private void MaximumDateLayout()
        {
            //Maximum Date Text
            TextView maxDate = new TextView(context);

            maxDate.SetPadding(0, 0, 0, 50);
            maxDate.Text     = "Max Date";
            maxDate.TextSize = 20;
            maxDate.Gravity  = GravityFlags.Left;

            //maxDateButton
            maxDateButton          = new Button(context);
            maxDateButton.Text     = maxTextDate;
            maxDateButton.TextSize = 16;
            maxDateButton.SetBackgroundColor(Color.ParseColor("#8CD4CF"));
            maxDatePicker        = new DatePickerDialog(context, MaxDateSetting, maxYear, maxMonth, maxDay);
            maxDateButton.Click += (object sender, EventArgs e) =>
            {
                maxDatePicker.Show();
            };

            //maxDateLayout
            LinearLayout maxDateLayout = new LinearLayout(context);

            maxDateLayout.Orientation = Android.Widget.Orientation.Vertical;
            maxDateLayout.SetPadding(0, 0, 0, 50);
            maxDateLayout.AddView(maxDate);
            maxDateLayout.AddView(maxDateButton);
            proprtyOptionsLayout.AddView(maxDateLayout);
        }
Пример #25
0
        void Button_Click(object sender, EventArgs e)
        {
            var value  = Value ?? DateTime.Today;
            var dialog = new DatePickerDialog(Context, this, value.Year, value.Month - 1, value.Day);

            dialog.Show();
        }
Пример #26
0
        /*private void SubmitButton_Click(object sender, EventArgs e)
         * {
         *  string fullNameText = fullName.EditText.Text;
         *  string nicText = nic.EditText.Text;
         *  string emailText = email.EditText.Text;
         *  string telephoneText = telephone.EditText.Text;
         *  string selectedDateText = selectDate.Text;
         *
         *  HashMap memberInfo = new HashMap();
         *  memberInfo.Put("fullName", fullNameText);
         *  memberInfo.Put("NIC", nicText);
         *  memberInfo.Put("Email", emailText);
         *  memberInfo.Put("telephone Number", telephoneText);
         *  memberInfo.Put("Birthday", birthday);
         *
         *  Android.App.AlertDialog.Builder saveMemberAlert = new Android.App.AlertDialog.Builder(this);
         *  saveMemberAlert.SetTitle("Save Alumni Info");
         *  saveMemberAlert.SetMessage("Are you sure?");
         *  saveMemberAlert.SetPositiveButton("Continue", (senderAlert, args) =>
         *  {
         *      DatabaseReference newMemberRef = AppDataHelper.GetDatabase().GetReference("Member").Push();
         *      newMemberRef.SetValue(memberInfo);
         *      this.Dispose();
         *  });
         *  saveMemberAlert.SetNegativeButton("Cancel", (senderAlert, args) =>
         *  {
         *      saveMemberAlert.Dispose();
         *  });
         *
         *  saveMemberAlert.Show();
         * }*/

        private void SelectDate_Click(object sender, EventArgs e)
        {
            var dateTimeNow             = DateTime.Now;
            DatePickerDialog datePicker = new DatePickerDialog(this, this, dateTimeNow.Year, dateTimeNow.Month, dateTimeNow.Day);

            datePicker.Show();
        }
Пример #27
0
        private void BtnSelection_Click(object sender, EventArgs e)
        {
            // Tháng trong DatePicker bắt đầu từ 0
            DatePickerDialog datePicker = new DatePickerDialog(view.Context, this, userDateTime.Year, userDateTime.Month - 1, userDateTime.Day);

            datePicker.Show();
        }
Пример #28
0
        private void _discountDate_Click(object sender, EventArgs e)
        {
            DatePickerDialog datePicker = new DatePickerDialog(this);

            datePicker.DateSet += DatePicker_DateSet;
            datePicker.Show();
        }
Пример #29
0
        internal protected override void Open()
        {
            // Note: Month needs to be -1 since on Android months go from 0-11
            // http://developer.android.com/reference/android/app/DatePickerDialog.OnDateSetListener.html#onDateSet(android.widget.DatePicker, int, int, int)

            _dialog = new DatePickerDialog(
                ContextHelper.Current,
                OnDateSet,
                Date.Year,
                Date.Month - 1,
                Date.Day
                );

            //Removes title that is unnecessary as it is a duplicate -> http://stackoverflow.com/questions/33486643/remove-title-from-datepickerdialog
            _dialog.SetTitle("");

            var minYearCalendar = Calendar.Instance;

            minYearCalendar.Set(MinYear.Year, MinYear.Month - 1, MinYear.Day, MinYear.Hour, MinYear.Minute, MinYear.Second);
            _dialog.DatePicker.MinDate = minYearCalendar.TimeInMillis;

            var maxYearCalendar = Calendar.Instance;

            maxYearCalendar.Set(MaxYear.Year, MaxYear.Month - 1, MaxYear.Day, MaxYear.Hour, MaxYear.Minute, MaxYear.Second);
            _dialog.DatePicker.MaxDate = maxYearCalendar.TimeInMillis;

            _dialog.DismissEvent += OnDismiss;
            _dialog.Show();
        }
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.LeaveRecall);

            //set date textview
            EditText edtRecallDt = FindViewById <EditText>(Resource.Id.edtRecallDt);

            //  edtExtendTo.Text = DateTime.Today.ToString("d");
            edtRecallDt.Click += (s, e) =>
            {
                var dateTimeNow             = DateTime.Now;
                DatePickerDialog datePicker = new DatePickerDialog
                                                  (this,
                                                  (sender, eventArgs) => { edtRecallDt.Text = eventArgs.Date.Day + "/" + eventArgs.Date.Month + "/" + eventArgs.Date.Year; },
                                                  dateTimeNow.Year, dateTimeNow.Month - 1, dateTimeNow.Day);
                datePicker.Show();
            };

            LoadSpinner();

            //get submit button and subscribe to its click event
            Button btnSubmitLvRec = FindViewById <Button>(Resource.Id.btnSubmitLvRec);

            btnSubmitLvRec.Click += btnSubmitLvRec_Click;
        }