小编Deu*_*tro的帖子

如何在Postgres 9.3中获取当前时区名称?

我想获得当前的时区名称.我已经实现的是通过以下方式获取utc_offset/timezone缩写:

SELECT * FROM pg_timezone_names WHERE abbrev = current_setting('TIMEZONE')
Run Code Online (Sandbox Code Playgroud)

这给了我这个时区的所有大陆/资本组合,但不是确切的时区.比如我得到:

Europe/Amsterdam
Europe/Berlin
Run Code Online (Sandbox Code Playgroud)

服务器在柏林,我想获得服务器的时区名称.

我在CET上遇到的问题是它始终是UTC + 01:00并且不考虑DST iirc.

postgresql timezone datetime

61
推荐指数
5
解决办法
7万
查看次数

在@Service中与@Kutlin一起使用的Spring Boot始终为null

目前我尝试使用Kotlin重写我的Java Spring Boot应用程序.我遇到了一个问题,在我的所有使用@Service依赖注入注释的类中都没有正常工作(所有实例都是null).这是一个例子:

@Service
@Transactional
open class UserServiceController @Autowired constructor(val dsl: DSLContext, val teamService: TeamService) {
  //dsl and teamService are null in all methods
}
Run Code Online (Sandbox Code Playgroud)

在Java中做同样的工作没有任何问题:

@Service
@Transactional
public class UserServiceController
{
    private DSLContext dsl;
    private TeamService teamService;

    @Autowired
    public UserServiceController(DSLContext dsl,
                             TeamService teamService)
    {
        this.dsl = dsl;
        this.teamService = teamService;
    }
Run Code Online (Sandbox Code Playgroud)

如果我用@ComponentKotlin 注释组件一切正常:

@Component
open class UserServiceController @Autowired constructor(val dsl: DSLContext, val teamService: TeamService) {
  //dsl and teamService are injected properly
}
Run Code Online (Sandbox Code Playgroud)

谷歌为Kotlin提供了许多不同的方法, …

java spring spring-mvc kotlin spring-boot

15
推荐指数
3
解决办法
5129
查看次数

将自定义道具传递给TypeScript中的Redux Form Field

我想将自定义属性传递给我的Redux-Form-Field.在文档中它说:

传递给Field的任何自定义道具都将合并到与输入和元对象相同级别的props对象中.

但是将自定义道具传递给Field组件会引发编译错误:

<Field
    name="E-Mail"
    component={MaterialTextField}
    myProp="Test"
/>
Run Code Online (Sandbox Code Playgroud)

属性'myProp'在类型'上不存在(IntrinsicAttributes&IntrinsicClassAttributes>&...

在props属性中,我只能添加一组预定义的属性,如占位符或类型.传递另一个道具会抛出此错误:

<Field
    name="E-Mail"
    component={MaterialTextField}
    props = {{
        myProps: 'Test'
    }}
/>
Run Code Online (Sandbox Code Playgroud)

输入'{name:"E-Mail"; 组件:(props:any)=>元素; 道具:{myProps:string; }; }'不能赋值给''(IntrinsicAttributes&...

是否有可能将自定义道具传递给TypeScript中的Field组件?

typescript reactjs redux-form react-redux

15
推荐指数
1
解决办法
5550
查看次数

更改TextField焦点上的标题

在我的Vaadin应用程序中,我想改变焦点TextField的颜色,这没有问题.另外我想改变属于TextField的标题的颜色.我怎样才能用css实现这个目标?

.v-textfield.textfield-default {
    border: none;
    border-bottom: 1px solid $non-active-field;
    outline: none;
    height: 3rem;
    font-size: 1rem;
    margin: 0 0 15px 0;
    padding: 0;
    box-shadow: none;
    box-sizing: content-box;
    transition: all 0.3s;
  }

  .v-textfield.textfield-default:focus {
    border-bottom: 1px solid $default;
  }

  .v-caption-default-caption {
    color: purple; //changes the text to purple
    top: 0.8rem;
    left: 0.75rem;
    font-size: 1rem;
    cursor: text;
    transition: .2s ease-out;
  }

  .v-caption-default-caption:focus {
    color: red; //is never called
  }

  .v-caption-default-caption:active {
    color: blue; //is never called either
  }
Run Code Online (Sandbox Code Playgroud)

css vaadin

1
推荐指数
1
解决办法
350
查看次数