Skip to content
This repository has been archived by the owner. 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

Comments

Projects
None yet
2 participants
@vova1987
Copy link

vova1987 commented Feb 23, 2016

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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 23, 2016

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

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 24, 2016

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 notifications@github.com
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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 24, 2016

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

@vova1987

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 24, 2016

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 notifications@github.com 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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 24, 2016

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

@vova1987

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 24, 2016

[image: Capture.PNG]

On Wed, Feb 24, 2016 at 9:09 PM Matt Lewis notifications@github.com 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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 24, 2016

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

@vova1987

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 24, 2016

An example screenshot:
capture

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 24, 2016

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

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 24, 2016

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 notifications@github.com 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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 24, 2016

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

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 25, 2016

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 notifications@github.com
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

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 25, 2016

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 dvorkin1987@gmail.com
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 notifications@github.com
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

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 27, 2016

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

@vova1987

This comment has been minimized.

Copy link
Author

vova1987 commented Feb 27, 2016

Thank you very much!!!! :)

On Sat, Feb 27, 2016, 6:51 PM Matt Lewis notifications@github.com 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.
You can’t perform that action at this time.