Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar module #3256

Closed
wants to merge 24 commits into from
Closed

Calendar module #3256

wants to merge 24 commits into from

Conversation

mdehoog
Copy link
Contributor

@mdehoog mdehoog commented Oct 28, 2015

I've created a Calendar (date/time picker) module. It depends on the Popup module and Table collection.

For examples, see here: https://jsbin.com/hubanufuva/

Let me know if there's things that can be improved or changed to fit better into the project.

Issue for reference: #191.

EDIT: implemented time picker.

EDIT 2: See this repository for a ready to install version: https://github.com/mdehoog/Semantic-UI-Calendar.

@brunotourinho
Copy link

first of all, thanks for sharing!
where can I download it?

can you extend the module to have month and year selection?
something like this one does: http://www.eyecon.ro/datepicker/

@brunotourinho
Copy link

@mdehoog i've downloaded from jsbin source, but got and error:

Calendar: No activator found for the calendar popup
f.error @ semantic.min.js:12
f.setup.popup @ semantic.min.js:12
f.initialize @ semantic.min.js:12
(anonymous function) @ semantic.min.js:12
jQuery.extend.each @ jquery-1.10.2.js:671
jQuery.fn.jQuery.each @ jquery-1.10.2.js:280
e.fn.calendar @ semantic.min.js:11
(anonymous function) @ Editar?IDMaterial=961&Page=0:85 

in my case, the date in the field is already filled, is there a date format config like 'dd/MM/yyyy'?

@mdehoog
Copy link
Contributor Author

mdehoog commented Oct 28, 2015

@brunotourinho You need an element that acts as the popup activator, ie an input or a button as a child element of the ui calendar element.

I've just committed a change that causes the calendar to automatically switch to inline mode if no activator element is found (instead of throwing the error).

@jlukic jlukic added this to the 2.x Changes milestone Oct 29, 2015
@lholznagel
Copy link

It looks very nice. 👍
It would be awesome if you add a timepicker :)

@cazzoo
Copy link

cazzoo commented Oct 29, 2015

👍 timepicker would be really neat addition to this cleany made datepicker

@mdehoog
Copy link
Contributor Author

mdehoog commented Oct 29, 2015

@brunotourinho Added year/month selection like the example given.
@cazzoo @KapuzenSohn Added timepicker.

@lholznagel
Copy link

@mdehoog Thanks!

@brunotourinho
Copy link

@mdehoog Awesome!!!
I'm from Brazil, so I have to ask you for localization config on the date format (short date) when date is selected as well when the field is already filled (editing mode), the default setting is "October 29, 2015" we should be able to change it to something like 10/29/2015 (mm/dd/yyyy for en-us) or 29/10/2015 (dd/MM/yyy for pt-br)

I cant wait to use it in production, one more time, thanks a lot! 😄

@mdehoog
Copy link
Contributor Author

mdehoog commented Oct 29, 2015

@brunotourinho Check out the "Day first" and "Custom format" examples in the linked jsbin.

@brunotourinho
Copy link

@mdehoog that's Perfect!

@brunotourinho
Copy link

@mdehoog When the field is set (editing mode) and we open the popup but don't select a date, when it closes, it resets the value to the placeholder value.

@brunotourinho
Copy link

@mdehoog another cool stuff, would be the option to change the month name and weekdays letters localization.
i.e. October (default en-us) -> Outubro (pt-br) and 'S/M/T/W/T/F/S' (default en-us) -> 'D/S/T/Q/Q/S/S' (pt-br)

@brunotourinho
Copy link

Unminified the code and found the answer for my second question:

text: { days: ["S", "M", "T", "W", "T", "F", "S"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", now: "Now", am: "AM", pm: "PM" }
😄

@cazzoo
Copy link

cazzoo commented Oct 29, 2015

I like it!!
Perfect addition

@mdehoog
Copy link
Contributor Author

mdehoog commented Oct 29, 2015

@brunotourinho Can't reproduce the "reset to placeholder" issue, can you provide a jsbin?
PS Instead of unminifying the jsbin source, you can see the module code in the "Files changed" tab at the top of this PR, or you can view the Calendar module in the PR's source fork: https://github.com/mdehoog/Semantic-UI/tree/calendar/src/definitions/modules.

@brunotourinho
Copy link

@mdehoog, I'll try to explain the steps, the jsbin is here https://jsbin.com/mopugunafo/1/edit?html,js,output:

  • I have a calendar with the value set
  • I Click on the input, to open the pop up (don't chose any date)
  • Click outside the input (to close the pop up)
  • It goes back to default

Maybe I'm having trouble setting the initial date.
is setting the 'value' property of the input the right way to work?

@mdehoog
Copy link
Contributor Author

mdehoog commented Oct 30, 2015

@brunotourinho Excellent, thanks for the jsbin! Bug fixed (jsbin in original post updated).

@danitz
Copy link

danitz commented Jan 28, 2017

Hi Everyone,

I noticed an issue when placing the calendar inside a modal box, after the modal shows up the calendar automatically showing up too not waiting for the input box clicked first.

I created a jsfiddle on this

https://jsfiddle.net/danitz/Lxdsbhcu/

any help is very much appreciated

@hinterlist
Copy link

hinterlist commented Jan 28, 2017

@danitz that would happen with any input component inside modal window. You need to set autofocus: false when initializing your modal window.

http://semantic-ui.com/modules/modal.html#/settings

@smartm0use
Copy link

@danitz I have already reported this bug some months ago. Please read my comment: #3256 (comment)

It is still a bug.

@danitz
Copy link

danitz commented Jan 30, 2017

@DimitryKislichenko thanks a lot it works

@Siriwatb
Copy link

Hi !
I need help . I want to change AD Year to BE Year

example : 2017 to 2560

@talha-asad
Copy link

@mdehoog

Calendar doesn't restores value when using Semantic UI's form API, e.g $('form.form').form('set values', {start_date: new Date()});

It does restore the input text value but not the actual hidden input value.

Additionally when a date is set it won't trigger a change event on the form, which happens with all other components.

@smartm0use
Copy link

@talha-asad You should add an issue here

@JoelTwilo
Copy link

Hi, I'm having a problem with the calendar. I'm using it as a date range picker but if I select a date in the first calendar it doesn't block out the date in the second calendar.

How would I achieve this behavior?

@smartm0use
Copy link

Have you followed the example?

$('#rangestart').calendar({
   type: 'date',
   endCalendar: $('#rangeend')
});
$('#rangeend').calendar({
  type: 'date',
  startCalendar: $('#rangestart')
});

Anyway you should use this repository to get support.

@diego1905
Copy link

Hello,

Is there a way to only disable all Sundays (make it disabled link) from being selected in inline calendar ?

Thanks

@kevinrjn
Copy link

Hi everyone, can someone tell me please how to use the formatter "cell" ? I've tried many ways but I always get an error. Thanks

@louwers
Copy link

louwers commented Jul 19, 2017

Has it been definitively decided that Semantic UI will not contain a date picker?

@smartm0use
Copy link

Yes.

@brownsugar
Copy link

Really nice plugin, hope this will officially included in Semantic UI soon.

@MariannaAtPlay
Copy link

@smartm0use why???

@awgv
Copy link
Member

awgv commented Aug 11, 2017

@MariannaAtPlay Jack said nothing about it, someone asked to close the PR and move it to a separate repository—that’s it. The component will or will not be added to the core.

@ctilley83
Copy link

@Banandrew It seems like Jack was willing and excited about this pull request if you read above. I'm sure when Jack returns to actively developing Semantic Ui, this discussion will resume. All modern css/component frameworks have a calendar module. Semantic UI should be no different. The issue that arises is from the uncertainty of this project's future. It's a great framework, but Jack has mentioned himself that currently he has zero time to work on this project. He says he'll return to the project, but that was a year ago. The "when" question is killing this project.

@rkrameshkumar71
Copy link

hi mdehoog,
last one week i am trying to implement semantic calendar like below link can you help me. i want to disable past dates in semantic calender.

http://jsfiddle.net/nicolapeluchetti/dAyzq/1/

@rkrameshkumar71
Copy link

@GuacheSuede
Copy link

#6109

@khornberg khornberg mentioned this pull request Feb 21, 2018
@contactjavas
Copy link

contactjavas commented Jul 13, 2018

Perhaps this component can be built in instead of becoming an extension

@lubber-de

This comment was marked as spam.

@brunotourinho
Copy link

Hey @lubber-de ,
Can you take a look on issue #3287
Maybe we can implement this on FUI.

@lubber-de

This comment was marked as spam.

@rsad1351
Copy link

rsad1351 commented Sep 1, 2019

Hi
Could you add Jalali calendar as an option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.