小编Par*_*gra的帖子

完整日历时间间隔应为1小时,从6:30开始

我尝试了这个实现完整日历实现.

    $("#available_classes_calendar").fullCalendar({
        header: {
             left   : 'prev,next',
             center : 'title'
            },
        defaultView: 'agendaWeek',
        views:{
            agenda:{
                allDaySlot: false,
                minTime: "06:30:00",
                maxTime: "24:00:00",
                slotDuration: "00:60:00"
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

在这个全天列应该从早上6:30开始,间隔时隙应该是1小时.

因此,全天列应如下所示:

早上6:30,早上7:30,上午8:30...晚上11:30

我尝试了很多解决方案,但无法实现这一目标.

如果需要任何其他信息来解决此问题,请与我们联系.

谢谢 @lucasnadalutti小提琴的截图

javascript jquery fullcalendar

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

在ActionCable中找不到"MyChannel"的订阅类

我在使用Action Cable时遇到问题,每当我运行我的程序时,我都会收到一条错误,指出Subscription找不到ClassConversationChannel

当我尝试发送消息时,我得到了这个日志

已成功升级到WebSocket(REQUEST_METHOD:GET,HTTP_CONNECTION:Upgrade,HTTP_UPGRADE:websocket)未找到订阅类:"ConversationChannel"无法从{"command"=>"message","identifier"=>"{\"channel执行命令\":\"ConversationChannel \"}","data"=>"{\"message \":[{\"name \":\"conversation_id \",\"value \":\"2 \"} {\ "名称\":\ "amitian_id \",\ "值\":\ "1 \"},{\ "名称\":\ "身体\",\ "值\":\"NMM\"}],\"action \":\"speak \"}"}} [RuntimeError - 无法找到带标识符的订阅:{"channel":"ConversationChannel"}]:C:/RailsInstaller/Ruby2.3.​​0/lib /ruby/gems/2.3.0/gems/actioncable-5.0.1/lib/action_cable/connection/subscriptions.rb:74:in find' | C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.1/lib/action_cable/connection/subscriptions.rb:53:in perform_action'| C:/RailsInstaller/Ruby2.3.​​0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.1/lib/action_cable/connection/subscriptions.rb:17:in execute_command' | C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.1/lib/action_cable/connection/base.rb:88:indispatch_websocket_message'| C:/RailsInstaller/Ruby2.3.​​0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker.rb:58:在`block in invoke'中

ConversationChannel.rb

class ConversationChannel < ApplicationCable::Channel
  def subscribed
    # stream_from "some_channel"
    stream_from "conversations-#{current_amitian.id}"
  end

  def unsubscribed
    # Any cleanup needed when channel is unsubscribed
    stop_all_streams
  end

  def speak(data)

    message_params = data['message'].each_with_object({}) do |el, hash|
      hash[el.values.first] = el.values.last
    end

    ActionCable.server.broadcast(
      "conversations-#{current_amitian.id}", …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 actioncable

6
推荐指数
3
解决办法
3210
查看次数

如何在当前列旁边添加表格列

我想在当前列旁边添加 TD 和 TH。这应该在我点击链接时添加。

这是 HTML:

<section class="yield-report-table">
  <table id="sorting">
    <tr class="headerrow ui-sortable">
      <th class="ui-resizable tac"><div class="ui-resizable">First Year Corn <br>Non Limited N, High Pop(1)</div></th>
      <th class="ui-resizable tac"><div class="ui-resizable">First Year Corn <br>Non Limited N, High Pop(2)</div></th>
    </tr>
    <tr>
      <td>
        <div class="report-icon-list bg-l-green">
          <a href="#" class="cht-add"><span><i class="cht-sprite">1</i></span></a>
        </div>
      </td>

      <td>
        <div class="report-icon-list bg-l-green">
          <a href="#" class="cht-add"><span><i class="cht-sprite">2</i></span></a>
        </div>
      </td> 
    </tr>
  </table> 
</section>
Run Code Online (Sandbox Code Playgroud)

JS:

<script>
  $(function() {
    $('.report-icon-list .cht-add').on("click",function(){
      $i = $(".report-icon-list .cht-add").parents("td").index(this);
      $n = $(".report-icon-list .cht-add").parents("#sorting tr th").index(this);
      $(this).parents("td:eq("+$i+")").after("<td>discription</td>");
      $("#sorting tr th:eq("+$n+")").after("<th>heading</th>"); …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

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

Rails 中带有 .SCSS 的背景图像?

我遵循了其他主题的建议,但无法让它发挥作用。我想设置背景图片。

我的 scss 文件是 custom.css.scss 和代码是正文

{ background-image: url("back.png"); }

back.png 位于 app/assets/images

custom.css.scss 位于 app/stylesheets

我没有问题让 back.png 通过我的 html 页面中的资产管道工作

<%= image_tag "back.png" %>

ruby-on-rails background-image

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

React - componentDidMount中的setState

我正在为图像构建一个延迟加载组件.但我设置状态有问题.我得到的只能更新已安装或安装的组件错误,但我在setState里面使用componentDidMount,这应该可以让我避免这样的错误.

这是我的代码:

export default class Images extends React.Component {
    constructor(props) {
        super(props);

        this.element = null;

        this.state = {
            loaded: false,
            height: 0
        };
    }

    componentDidMount() {
        this.element = findDOMNode(this);

        this.loadImage();
    }

    getDimensions() {
        const w = this.element.offsetWidth;

        let initw = 0;
        let inith = 0;

        let result;

        const img = new Image();
        img.src = this.props.url;

        img.onload = (e) => {
            initw = e.path[0].width;
            inith = e.path[0].height;

            result = (w / initw) * inith;

            setTimeout(() …
Run Code Online (Sandbox Code Playgroud)

reactjs

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

反应| 蚂蚁设计选择默认值

我在项目中使用蚂蚁设计

在这里,我有一个选择作为动态字段。当我尝试为select设置默认值时。没用

<Select defaultValue="lucy">
  <Option value="jack">Jack</Option>
  <Option value="lucy">Lucy</Option>
  <Option value="Yiminghe">yiminghe</Option>
</Select>
Run Code Online (Sandbox Code Playgroud)

我将defaultvalue设置为,lucy但不起作用

复制代码:https : //codesandbox.io/s/6x3qv6wymr

javascript reactjs antd

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

Javascript Uncaught TypeError : .split 不是函数

我想做一个功能,用户每天只能领取一次硬币。我做了这个函数,.split以便它只比较日期,因为Date()只比较日期和时间。但是,我收到了这个 javascript 错误:

未捕获的 TypeError(中间值)。split 不是函数

有谁知道如何解决这个问题?我尝试了很多方法。错误仍然存​​在。

这是我的代码:

$(document).ready(function () {
  if (new Date(model[0].lastClaimedDate).split(' ')[0] < new Date().split(' ')[0]) {
    document.getElementById('btnAddCoins').disabled = false;
  }
  else {
    document.getElementById('btnAddCoins').disabled = true;
  }   
})
Run Code Online (Sandbox Code Playgroud)

javascript

3
推荐指数
1
解决办法
4万
查看次数

Postgres - 将元素作为数组重复 N 次

例如,如果元素是'hi',而N3,我需要一个可以在SELECT返回以下数组的查询中使用的 PostgreSQL 片段:

['hi', 'hi', 'hi']
Run Code Online (Sandbox Code Playgroud)

postgresql postgres-9.6

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

Angular 2如何从路由组件中发出数据

当我尝试将数据发送到变量dataStr然后我console print在应用程序组件中它返回undefined;如何将数据从主组件传递到应用程序组件?

app.component.ts

import { Component, OnInit } from '@angular/core';

@Component({
    selector: 'main',
    templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit {

    public dataStr: string;

    setDataStr(dataStr) {
        console.log(dataStr);
    }
}
Run Code Online (Sandbox Code Playgroud)

app.component.html

<router-outlet (dataStr)="setDataStr($event)"></router-outlet>
Run Code Online (Sandbox Code Playgroud)

home.component.ts

import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';

@Component({
    selector: 'home-page',
    template: `<h1>Test</h1>`
})
export class HomeComponent implements OnInit {

    @Output()
    dataStr = new EventEmitter();

    ngOnInit() { …
Run Code Online (Sandbox Code Playgroud)

javascript angular

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

以反应最终形式更改嵌套字段的值

我们正在使用 React Final Form 库,并希望更改用户选择的嵌套字段的值。

它基本上是地址形式,在选择 时Suburb,我想更改postcodestate。address 又是一个嵌套的表单对象。我的数据集看起来像:-

{
  name: 'xyzx',
  address: {
    suburb: 'xx',
  },
}
Run Code Online (Sandbox Code Playgroud)

我正在通过以下 mutator

export const changeValueMutator: Mutator = ([name]: string[], state: MutableState, { changeValue }: Tools) => {
  console.log(state, name);
  changeValue(state, name, value => (value));
};
Run Code Online (Sandbox Code Playgroud)

并将其称为

this.props.changeValue('address.suburb', item.suburb);
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-final-form

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