Skip to content

Calendar module#3256

Closed
mdehoog wants to merge 24 commits into
Semantic-Org:nextfrom
mdehoog:calendar
Closed

Calendar module#3256
mdehoog wants to merge 24 commits into
Semantic-Org:nextfrom
mdehoog:calendar

Conversation

@mdehoog

@mdehoog mdehoog commented Oct 28, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown

@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

mdehoog commented Oct 28, 2015

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown

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

@cazzoo

cazzoo commented Oct 29, 2015

Copy link
Copy Markdown

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

@mdehoog

mdehoog commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

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

@lholznagel

Copy link
Copy Markdown

@mdehoog Thanks!

@brunotourinho

Copy link
Copy Markdown

@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

mdehoog commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

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

@brunotourinho

Copy link
Copy Markdown

@mdehoog that's Perfect!

@brunotourinho

Copy link
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown

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

cazzoo commented Oct 29, 2015

Copy link
Copy Markdown

I like it!!
Perfect addition

@mdehoog

mdehoog commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown

@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

mdehoog commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

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

@danitz

danitz commented Jan 28, 2017

Copy link
Copy Markdown

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

hinterlist commented Jan 28, 2017

Copy link
Copy Markdown

@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
Copy Markdown

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

It is still a bug.

@danitz

danitz commented Jan 30, 2017

Copy link
Copy Markdown

@DimitryKislichenko thanks a lot it works

@Siriwatb

Copy link
Copy Markdown

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

example : 2017 to 2560

@talha-asad

Copy link
Copy Markdown

@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
Copy Markdown

@talha-asad You should add an issue here

@JoelTwilo

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

Hello,

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

Thanks

@kevinrjn

Copy link
Copy Markdown

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

louwers commented Jul 19, 2017

Copy link
Copy Markdown

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

@smartm0use

Copy link
Copy Markdown

Yes.

@brownsugar

Copy link
Copy Markdown

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

@MariannaAtPlay

Copy link
Copy Markdown

@smartm0use why???

@awgv

awgv commented Aug 11, 2017

Copy link
Copy Markdown
Member

@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
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

@GuacheSuede

Copy link
Copy Markdown

#6109

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

contactjavas commented Jul 13, 2018

Copy link
Copy Markdown

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

@lubber-de

This comment was marked as spam.

@brunotourinho

Copy link
Copy Markdown

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

rsad1351 commented Sep 1, 2019

Copy link
Copy Markdown

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.