Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

WeekView on-timespan-click does not pass clicked day #291

Closed
vova1987 opened this issue Feb 23, 2016 · 15 comments
Closed

WeekView on-timespan-click does not pass clicked day #291

vova1987 opened this issue Feb 23, 2016 · 15 comments

Comments

@vova1987
Copy link

When using the on-timespan-click callback of the week view, only the clicked hour is passed as parameter.
It would be extremely helpful to also pass the date on which the user clicked - for example if I would like to create a new event on the clicked day and time.

@mattlewis92
Copy link
Owner

A date object should already passed to the callback:
https://github.com/mattlewis92/angular-bootstrap-calendar/blob/master/src/templates/calendarHourList.html#L8

If I'm on about a different thing let me know 😄

@vova1987
Copy link
Author

You are right - it is passed... But, it contains only the time portion
(e.g. 09:00) - the DATE part (e.g. 22/02/2016) is always the same - no
matter what day I click on. The issue to make it pass the correct day as
well.

On Wed, Feb 24, 2016 at 12:29 AM Matt Lewis [email protected]
wrote:

A date object should already passed to the callback:

https://github.com/mattlewis92/angular-bootstrap-calendar/blob/master/src/templates/calendarHourList.html#L8

If I'm on about a different thing let me know [image: 😄]


Reply to this email directly or view it on GitHub
#291 (comment)
.

@mattlewis92
Copy link
Owner

Sorry I can't replicate this, can you show me a screenshot of the part you're clicking?

@vova1987
Copy link
Author

Sure:[image: Capture.PNG]
Note: to support RTL, I ran the CSS through an RTL css tool (the same one
used by bootsrap-RTL)

On Wed, Feb 24, 2016 at 8:00 PM Matt Lewis [email protected] wrote:

Sorry I can't replicate this, can you show me a screenshot of the part
you're clicking?


Reply to this email directly or view it on GitHub
#291 (comment)
.

@mattlewis92
Copy link
Owner

Sorry I can't see that image, it just displays as [image: Capture.PNG], can you send it again?

@vova1987
Copy link
Author

[image: Capture.PNG]

On Wed, Feb 24, 2016 at 9:09 PM Matt Lewis [email protected] wrote:

Sorry I can't see that image, it just displays as [image: Capture.PNG],
can you send it again?


Reply to this email directly or view it on GitHub
#291 (comment)
.

Thats the only way I can send it... can you give a regular gmail address to
send it to?

@mattlewis92
Copy link
Owner

It's still coming through as [image: Capture.PNG], maybe try natively through github?

@vova1987
Copy link
Author

An example screenshot:
capture

@mattlewis92
Copy link
Owner

Oh I get what you mean now, I'm not sure if that's even possible as there isn't a grid of cells where I could put click handlers. I'll have a think about it and get back to you, but it's pretty unlikely as I can't see a simple way of implementing it.

@vova1987
Copy link
Author

I would really appreciate it! Thank you for the quick response.
Maybe you have an Idea for a workaround to this issue? perhaps a way to get
the day when adding a custom ng-click listener on the entire view (on my
side)?

On Wed, Feb 24, 2016 at 9:45 PM Matt Lewis [email protected] wrote:

Oh I get what you mean now, I'm not sure if that's even possible as there
isn't a grid of cells where I could put click handlers. I'll have a think
about it and get back to you, but it's pretty unlikely as I can't see a
simple way of implementing it.


Reply to this email directly or view it on GitHub
#291 (comment)
.

@mattlewis92
Copy link
Owner

The 2 ideas I currently have, neither of which are easy to implement are:

  • Create a hidden set of divs the same sizes as the column headers that overlay the current time rows and put the click handlers there
  • Use the x-y co-ordinates of the click event to calculate on which day the event was clicked

@vova1987
Copy link
Author

I like the second Idea... I think it might even be not that difficult...
I am relatively new to angular, but I found the following piece of code
that looks promising:

app.controller('MainCtrl', function($scope, $element) {
var elInput = $element.find('input');
alert(elInput[0].offsetWidth);
$scope.name = 'World';});

Knowing the layout of the Weekly View, I guess we could use the $element to
calculate the offset on click.

I will try it myself and let you know...

On Wed, Feb 24, 2016 at 10:37 PM Matt Lewis [email protected]
wrote:

The 2 ideas I currently have, neither of which are easy to implement are:

  • Create a hidden set of divs the same sizes as the column headers
    that overlay the current time rows and put the click handlers there
  • Use the x-y co-ordinates of the click event to calculate on which
    day the event was clicked


Reply to this email directly or view it on GitHub
#291 (comment)
.

@vova1987
Copy link
Author

I tried looking at it in the source... sorry.. my javascript just isn't
good enough...
Do you think you can also take a look and see if it's possible?
Thanks,
Vladimir

On Thu, Feb 25, 2016 at 9:44 AM Vladimir Dvorkin [email protected]
wrote:

I like the second Idea... I think it might even be not that difficult...
I am relatively new to angular, but I found the following piece of code
that looks promising:

app.controller('MainCtrl', function($scope, $element) {
var elInput = $element.find('input');
alert(elInput[0].offsetWidth);
$scope.name = 'World';});

Knowing the layout of the Weekly View, I guess we could use the $element
to calculate the offset on click.

I will try it myself and let you know...

On Wed, Feb 24, 2016 at 10:37 PM Matt Lewis [email protected]
wrote:

The 2 ideas I currently have, neither of which are easy to implement are:

  • Create a hidden set of divs the same sizes as the column headers
    that overlay the current time rows and put the click handlers there
  • Use the x-y co-ordinates of the click event to calculate on which
    day the event was clicked


Reply to this email directly or view it on GitHub
#291 (comment)
.

@mattlewis92
Copy link
Owner

I found a way to implement it, it'll be in the next release 😄

@vova1987
Copy link
Author

Thank you very much!!!! :)

On Sat, Feb 27, 2016, 6:51 PM Matt Lewis [email protected] wrote:

I found a way to implement it, it'll be in the next release [image:
😄]


Reply to this email directly or view it on GitHub
#291 (comment)
.

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

No branches or pull requests

2 participants