Comments (9)
Oh I was terribly wrong!
When I write
val x = 3 seconds // type inference says it's a com.github.nscala_time.time.DurationBuilder
So I need an implicit conversion from DurationBuilder, but it's a private class! So the following just won't compile
package implicit_vs_private
import scala.concurrent.duration.{Duration => ScalaDuration}
import com.github.nscala_time.time.Imports._
import com.github.nscala_time.time.DurationBuilder
object Test {
implicit def NscalaDurationBuilder2Duration(x: DurationBuilder) : ScalaDuration = ScalaDuration.fromNanos(x.standardDuration.getMillis * 1000000)
}
from nscala-time.
Hi. There are another request to make DurationBuilder
public already. Whether we accept your proposal, to implicit converion to nscala-time, or not, I'd like to make DurationBuilder
public. Since DurationBuilder
is mostly internal representation, it's not so good to make it public, but I'd like to do it for convenience.
What do you think? /cc: @gakuzzzz @xuwei-k @tototoshi
from nscala-time.
I'm your side, @kmizu. I's not so good to make it public
However, we dont have more better solution... mmm
from nscala-time.
Today, I decided to make DurationBuilder
public since another elegant solution could not be found.
I'll create the PR to do it.
from nscala-time.
Fixed via #64
from nscala-time.
What you think about to include @kepkin conversion's into nscala-time?
I think it would be very useful.
from nscala-time.
@yokomizor OK. I think it's a good idea to add @kepkin conversion's into nscala-time. Since I'm a little busy, it helps us if you create the PR to add @kepkin conversion's into nscala-time. Or please wait a while for creating the PR.
from nscala-time.
@yokomizor Note that Since nscala-time is simple sbt project, I think that you can edit nscala-time code easily via text editors or IDEs (Especially, IntelliJ IDEA + Scala Plugin).
from nscala-time.
@yokomizor I'm sorry to late response. After I create the PR #69 and the PR's badness is point outed, I found it bad idea that @kepkin conversions are included into nscala-time. Then, I close this issue.
from nscala-time.
Related Issues (20)
- Latest Version publish HOT 1
- Drop Scala 2.9.3 support in newer version HOT 1
- Conversion from Interval to FiniteDuration HOT 4
- max min to DateTime HOT 3
- Add support for multiplication of constant with duration HOT 1
- Check if date is within time range
- RichLong is missing timezone-aware helpers
- Release for Scala 2.12.0 HOT 1
- Possible improvement: DateTime + FiniteDuration syntax
- Get weird result when I want to find period between two dates and subtract some date by it HOT 1
- Release with the latest joda HOT 1
- API changes report for Nscala Time
- Unexpected behaviour with setting DateTime to Midnight HOT 2
- Possible improvement: add the ability to exclude the end of the interval when splitting by period
- Where can I find current release notes?
- Reasons behind now() change? HOT 1
- What do you think about implicit toDateTime over long HOT 1
- New released needed for JDK 1.8u60 HOT 2
- Migrate to java.time HOT 1
- support for min / max operations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nscala-time.