Commit Graph

57 Commits

Author SHA1 Message Date
Penar Musaraj a799268b66 FIX: Bugs with year selector and erase button (#17749) 2022-08-02 09:58:38 -04:00
Martin Brennan 54a518b21d FIX: Quoting local dates bbcode regeneration (#17141)
This commit allows quoting of discourse-local-date elements
and converts the quoted tags back into bbcode so that the
rendered quote will also render the discourse-local-date HTML.
This works on single dates as well as date ranges, and supports
all of the options used by discourse-local-date.

This also necessitated adding addTextDecorateCallback to the
to-markdown core lib (similar to addBlockDecorateCallback and
addTagDecorateCallback) to transform the text nodes between
date ranges to remove the -> in the final quote.

c.f. https://meta.discourse.org/t/quotes-that-contain-date-time/101999
2022-06-21 10:07:21 +10:00
Jarek Radosz 36c2284dea DEV: Fix typos "formated" -> "formatted" (#17156)
(nothing in all-the* relies on these)
2022-06-20 20:02:05 +02:00
Penar Musaraj 943083f4df DEV: Include helper in core for applyLocalDates (#16325) 2022-03-30 20:58:38 -04:00
Penar Musaraj febe997bee FIX: Regression in timezone name localizations (#15761)
This also switches to using the NPM package for better build stability. And adds a clearer label in the alert that is displayed to show your current timezone (when changing timezones).
2022-02-02 23:41:42 +01:00
Krzysztof Kotlarek 17ec3bc5b9 FEATURE: date-range tag for local dates (#15474)
New range tag for local dates with syntax like:
```
[date-range from=2022-01-06T13:00 to=2022-01-08 timezone=Australia/Sydney]
```

Previously, 2 dates in one line were considered as range. It was hard to decide if 2 dates are range when they were in separate lines or have some content between them.

New explicit tag should clearly distinguish between single date and range.

Common code from `addLocalDate` is extracted to `addSingleLocalDate`.

Both `addLocalDate` and new `addLocalRange` are using `addSingleLocalDate`.

Also, `defaultDateConfig` was extracted to have one place for all possible parameters.
2022-01-10 08:02:36 +01:00
Jarek Radosz 906a71a607 DEV: Fix linting issues in core plugins (#14916) 2021-11-13 15:31:42 +01:00
Jarek Radosz 4ad77f3382 DEV: Remove .es6 extensions from core (#14912)
Still supported in plugins though.
2021-11-13 12:51:53 +01:00
Martin Brennan 431f0dce4c DEV: Update discourse-local-dates for eslint shorthand rule (#14872)
See https://github.com/discourse/eslint-config-discourse/commit/4f7aba06c03fdd22bb26669aeb8ed4af3127c409
2021-11-10 11:58:11 +11:00
Mark VanLandingham c9e7b64a64 DEV: Add toolbar button when chat in installed (#14422) 2021-09-22 13:46:06 -05:00
Roman Rizzi 142e0ae062 Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509)
* Revert "Revert "DEV: Wrap `Ember.run.debounce`. (#11352)" (#11465)"

This reverts commit aa0d4ea764.

* Correctly debounce onScroll function
2020-12-18 10:18:52 -03:00
Roman Rizzi aa0d4ea764 Revert "DEV: Wrap Ember.run.debounce. (#11352)" (#11465)
This reverts commit 8b426431a4.
2020-12-10 16:48:25 -03:00
Roman Rizzi 8b426431a4 DEV: Wrap Ember.run.debounce. (#11352)
We want to wrap the `Ember.run.debounce` function and internally call `Ember.run` instead when running tests.

This commit changes discourseDebounce to work the same way as `Ember.run.debounce`.

Now that `discourseDebounce` works exactly like `Ember.run.debounce`, let's replace it and only use `DiscourseDebounce` from now on.

Move debounce to discourse-common to be able to reuse it in different bundles

Keep old debounce file for backwards-compatibility
2020-12-10 11:01:42 -03:00
Roman Rizzi bbe5d8d5cf DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
Joffrey JAFFEUX bf88410126 DEV: apply coding standards to plugins (#10594) 2020-09-04 13:51:53 +02:00
Jarek Radosz 26260d50b1 DEV: Import I18n in standard plugins (#10098) 2020-06-22 02:36:45 +02:00
Joffrey JAFFEUX 1dd9df9cd0 REFACTOR: removes overwritten properties and duplicates fn (#9686) 2020-05-07 16:39:53 +02:00
Joffrey JAFFEUX 4e0b2ae294 DEV: defines a constant for INPUT_DELAY (#9169) 2020-03-11 15:28:16 +01:00
Jarek Radosz 48ba65f406 DEV: Clean up Ember imports (#8979)
Includes:
* Import `computed` helpers
* Import `@ember/application`
* Import `isBlank` from `@ember/utils`
* Import `A` from `@ember/array`
* Import `EmberArray` from `@ember/array`
* Import `ArrayProxy` from `@ember/array/proxy`
* Import `warn` from `@ember/debug`
* Import `EmberObject` from `@ember/object`
* Import `Application` from `@ember/application`
* Import `EmberRouter` from `@ember/routing/router`
* Import `isPresent` from `@ember/utils`
* Import `computed` from `@ember/object`
* Import `guidFor` from `@ember/object`
* Import `isArray` from `@ember/array`
* Import `TextField` from `@ember/component`
* Import `TextArea` from `@ember/component`
* Import `Promise` from `rsvp`
* Import `Evented` from `@ember/object/evented`
* Replace deprecated `ember-addons/ember-computed-decorators` imports
2020-03-06 23:49:28 +01:00
Penar Musaraj 6be685ac67 DEV: Find/replace deprecated decorators 2020-02-19 11:49:56 -05:00
Jarek Radosz fe588cc7f8 DEV: Fix function prototype deprecations (#8681)
* DEV: Fix the function prototype observers deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}). [deprecation id: function-prototype-extensions.observes] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-observes for more details.

* DEV: Fix the function prototype event listeners deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}). [deprecation id: function-prototype-extensions.on] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on for more details.

* DEV: Simplify `default as` imports

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-01-16 18:56:53 +01:00
Robin Ward da04c602ba REFACTOR: Remove debounce to discourseDebounce
Otherwise it can be confused with the ember debounce
2019-11-11 13:34:01 -05:00
Robin Ward 90f934a660 REFACTOR: Use a module for Ember.isEmpty 2019-11-01 13:50:15 -04:00
Robin Ward 8d34f4bbd9 Revert "Revert Ember.run refactors"
This reverts commit fcb1ca52f9.
2019-10-30 09:48:24 -04:00
Robin Ward fcb1ca52f9 Revert Ember.run refactors
This reverts commit 5ca60fcb6b.
2019-10-29 17:10:47 -04:00
Robin Ward 5ca60fcb6b REFACTOR: Use imports for Ember.run 2019-10-29 15:31:56 -04:00
Robin Ward a8a76198b1 REFACTOR: Remove Ember.Component global variable
Use imports instead.
2019-10-23 12:30:52 -04:00
Joffrey JAFFEUX f4543ff02a FIX: ensures pikaday picker is showing in UTC (#7968) 2019-08-06 08:41:38 +02:00
Gerhard Schlager a68d8de72f UX:UX: Use shorter weekday labels in local-dates plugin 2019-08-05 14:21:59 +02:00
Joffrey JAFFEUX bfea922167 DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592) 2019-05-27 10:15:39 +02:00
Joffrey JAFFEUX f3a346464e FIX: allTimezonesd was mistakenly removed (#7513) 2019-05-09 10:22:54 +02:00
Joffrey JAFFEUX 5c8213ffd3 removes debugging statement (#7362) 2019-04-11 15:02:38 +02:00
Joffrey JAFFEUX 7dd684744c UX: sets min date on calendar when initial date is set (#7361) 2019-04-11 14:37:39 +02:00
Joffrey JAFFEUX 46dc38e5a5 UX: minor local-dates form improvements (#7360) 2019-04-11 14:03:53 +02:00
Joffrey JAFFEUX 7226240df3 UX: full revamp of local-dates form (#7357) 2019-04-11 11:14:34 +02:00
Joffrey JAFFEUX ad5edc8bb1 UX: copy and formating improvements to local-dates form (#7343) 2019-04-09 10:33:01 +02:00
Joffrey JAFFEUX 02d8931425 UX: more compact local-dates preview (#7305) 2019-04-02 14:39:20 +02:00
Joffrey JAFFEUX 9a56b398a1 UX: improves local-dates form (#7268) 2019-03-28 16:34:56 +01:00
Penar Musaraj 9bf11a7c02 FEATURE: Add localized timezone names (#7004)
Uses github.com/discourse/moment-timezone-names-translations to translate timezone names.
Plugins can also provide their own timezone name translations.
2019-02-25 14:40:02 -05:00
Joffrey JAFFEUX 523e0248e1 FIX: recurrence was not applied when selected in the form (#6820) 2018-12-28 12:36:49 +01:00
Joffrey JAFFEUX b0d08b5a8c FEATURE: refactoring and better handling of special cases (#6666) 2018-11-26 14:20:32 +01:00
Joffrey JAFFEUX 3ff3bb6e2a FIX: improves code, tests and utc handling of local-dates (#6644) 2018-11-22 17:19:24 +01:00
Joffrey JAFFEUX c4ed353fae DEV: removes _.map from codebase (#6616) 2018-11-19 10:46:46 +01:00
Vinoth Kannan 7a6c227fa4 UX: Use local timezone for insert date modal result 2018-10-09 20:15:32 +05:30
Joffrey JAFFEUX 3ed9533066 FEATURE: adds support for seconds in local-dates (#6339) 2018-08-30 12:38:05 +02:00
Joffrey JAFFEUX c580a39d49 FIX: infers time from tz creator to ensure day shown is the one expected 2018-07-16 01:04:50 +02:00
Joffrey JAFFEUX 6e3a2197f8 FIX: removes UTC conversion when date and no time 2018-07-05 10:58:53 +02:00
Joffrey JAFFEUX d12194c438 FIX: uses a non cooked to emoji arrow for local dates ranges 2018-07-04 23:56:56 +02:00
Jeff Wong 61955d2aa1 FIX: only change to time format when dealing with today's time 2018-07-02 16:50:15 -07:00
Joffrey JAFFEUX acd1693dac FEATURE: simplifies the same day hour to hour use case in local dates 2018-06-25 22:16:07 +02:00