-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Add to Google Calendar #5392
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
Changes from 1 commit
906a2bb
0a50938
f8100f0
ebadc8d
d258d8b
990da57
7d4fa22
146f940
603a58d
60c3027
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import moment from 'moment'; | ||
export default Component.extend({ | ||
classNames: ['ui', 'basic', 'segment'], | ||
|
||
calender: computed(function() { | ||
const params = this.get('event'); | ||
const startparams = params.startsAt; | ||
const endparams = params.endsAt; | ||
const starttime = moment(startparams).tz('Asia/Kolkata').utc().format('YYYYMMDD[T]HHmmSS[Z]'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The site doesn't only work for India There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
const endtime = moment(endparams).tz('Asia/Kolkata').utc().format('YYYYMMDD[T]HHmmSS[Z]'); | ||
return `https://calendar.google.com/calendar/u/0/r/eventedit?dates=${starttime}/${endtime}&text=${params.name}&location=${this.get('eventlocation')}&sf=true`; | ||
}) | ||
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="ui list"> | ||
<div class="content"> | ||
<li>{{header-date @event.startsAt}} To {{header-date @event.endsAt}}</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use general date helper and format it. And also I don't think it is needed here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i use it to give a similar format like given in the photo in the issue and i think its looking fine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. your format is not similar to this - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's wasn't same previously too, look closely There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can i make a new helper for the same format? |
||
<a href={{this.calender}}>Add To Calender</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to Google calendar, or add a google calendar icon. |
||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Component | public/add-to-calender', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function(assert) { | ||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.set('myAction', function(val) { ... }); | ||
|
||
await render(hbs`{{public/add-to-calender}}`); | ||
|
||
assert.equal(this.element.textContent.trim(), ''); | ||
|
||
// Template block usage: | ||
await render(hbs` | ||
{{#public/add-to-calender}} | ||
template block text | ||
{{/public/add-to-calender}} | ||
`); | ||
|
||
assert.equal(this.element.textContent.trim(), 'template block text'); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use glimmer component