0

I have a code that is used in .NET Core MVC and its like

<div class="col-xs-6 col-sm-6 col-md-6 mt-15">
  <label>Start Date</label>
  <div class="form-group">
    <div class='input-group date'>
      <input type='text' class="form-control" autocomplete="off" id="dtpstr" />
      <div class="datapicker-icon"><i class="fa fa-calendar" aria-hidden="true"></i></div>
    </div>
  </div>
</div>
$(document).ready(function () {
  $('#dtpstr').datetimepicker(
  {
    format: 'LT',
    useCurrent: false
  });
});

the below image is the output

Only hours, minutes and AM/PM is showing

the problem is that i can't select time when i use this and it only shows the time when i include HH:MM.

I want to show the date, and time with an intervel of 15 minutes.

I tried changing the format to

$(document).ready(function () {
  $('#dtpstr').datetimepicker(
  {
    format: 'DD/MM/YYYY',
    useCurrent: false
  });
});

Only date is showing

the above code doesn't work and still shoed the same thing. I could see a clock icon when i click on the text area and when i click in the clock the Hour and minutes shows and the icon changes to calender. When clicking on the calender the icon changes back to clock and the results are still same. No date picker.

I also tried to change the below one.

$(document).ready(function () {
  $('#dtpstr').datetimepicker(
  {
    format: 'DD/MM/YYYY, HH:MM',
    useCurrent: false
  });
});

Clock icon

Onclicking the above icon the Minute section only arrives

Got the same result, nothing changes, and did this one below also, this one changes date only and only to year 2000 backwards, couldn't change year before 2000 unless the year is been typed in the textbox after selecting a date from 2000 to todays date..

$(document).ready(function () {
  $('#dtpstr').datetimepicker(
  {
    format: 'L',
    useCurrent: false
  });
});

this above core results in

Year selection from only 2000

when 1999 is entered mannually, the range varies from 1900 - 2007

years showing from 1900 - 2007

  • It's unclear what your issue is or what output you're trying to get. It's also unclear which date/timepicker you are using as you've tagged both jquery-ui and bootstrap time picker. Limiting to 15 min intervals might not be an option for the date/timepicker you've chosen and the only option is to find a different one or write your own. Some do allow "plugins", so that may be another option. – freedomn-m Nov 25 '22 at 12:00
  • The issue is 1. I can't select date and time at the same time. 2. When i select the date the year won't go back before 2000 unless its selcted mannually (by typing any year other than 2000 to 2107. – joseph thomas Nov 28 '22 at 04:17
  • Hi @josephthomas, could you pls share your js and css reference, not sure which datetimepicker do you use. You could also check this answer:https://stackoverflow.com/a/62056141/11398810 – Rena Nov 28 '22 at 09:22
  • I don't know where that part is been set and i will look into the given answer. – joseph thomas Nov 28 '22 at 12:19

0 Answers0